Class ContentWindow
One of the main editor windows used to present workspace content and user scripts. Provides various functionalities for asset operations.
Inheritance
Implements
Namespace: FlaxEditor.Windows
Assembly: FlaxEngine.CSharp.dll
Syntax
public sealed class ContentWindow : EditorWindow, IComparable, IDrawable
Constructors
ContentWindow(Editor)
Initializes a new instance of the ContentWindow class.
Declaration
public ContentWindow(Editor editor)
Parameters
Editor
editor
The editor. |
Properties
CurrentViewFolder
Gets the current view folder.
Declaration
public ContentFolder CurrentViewFolder { get; }
Property Value
FlaxEditor.Content.ContentFolder
|
SelectedNode
Gets the selected tree node.
Declaration
public ContentTreeNode SelectedNode { get; }
Property Value
ContentTreeNode
|
Toolstrip
UseLayoutData
Gets a value indicating whether window uses custom layout data.
Declaration
public override bool UseLayoutData { get; }
Property Value
System.Boolean
|
Overrides
View
Gets the assets view.
Declaration
public ContentView View { get; }
Property Value
FlaxEditor.Content.GUI.ContentView
|
Methods
ClearItemsSearch()
Clears the items searching query text and filters.
Declaration
public void ClearItemsSearch()
Delete(ContentItem)
Deletes the specified item. Asks user first and uses some GUI.
Declaration
public void Delete(ContentItem item)
Parameters
FlaxEditor.Content.ContentItem
item
The item to delete. |
Delete(List<ContentItem>)
Deletes the specified items. Asks user first and uses some GUI.
Declaration
public void Delete(List<ContentItem> items)
Parameters
System.Collections.Generic.List<FlaxEditor.Content.ContentItem>
items
The items to delete. |
Duplicate(ContentItem)
Clones the specified item.
Declaration
public void Duplicate(ContentItem item)
Parameters
FlaxEditor.Content.ContentItem
item
The item. |
Duplicate(List<ContentItem>)
Duplicates the specified items.
Declaration
public void Duplicate(List<ContentItem> items)
Parameters
System.Collections.Generic.List<FlaxEditor.Content.ContentItem>
items
The items. |
Navigate(ContentTreeNode)
NavigateBackward()
NavigateForward()
NavigateUp()
NavigationClearHistory()
NewFolder()
Starts creating the folder.
Declaration
public void NewFolder()
NewItem(ContentProxy, Object, Action<ContentItem>, String, Boolean)
Starts creating new item.
Declaration
public void NewItem(ContentProxy proxy, object argument = null, Action<ContentItem> created = null, string initialName = null, bool withRenaming = true)
Parameters
FlaxEditor.Content.ContentProxy
proxy
The new item proxy. |
System.Object
argument
The argument passed to the proxy for the item creation. In most cases it is null. |
System.Action<FlaxEditor.Content.ContentItem>
created
The event called when the item is crated by the user. The argument is the new item. |
System.String
initialName
The initial item name. |
System.Boolean
withRenaming
True if start initial item renaming by user, or tru to skip it. |
OnDestroy()
Method called when managed instance should be destroyed
Declaration
public override void OnDestroy()
Overrides
OnExit()
Called when editor is being closed and window should perform release data operations.
Declaration
public override void OnExit()
Overrides
OnInit()
Called when window should be initialized. At this point, main window, content database, default editor windows are ready.
Declaration
public override void OnInit()
Overrides
OnLayoutDeserialize()
Called when during windows layout deserialization if window has no layout data to load. Can be used to restore default UI layout.
Declaration
public override void OnLayoutDeserialize()
Overrides
OnLayoutDeserialize(XmlElement)
Called when during windows layout deserialization. Each window can use it to load custom interface data (eg. splitter position).
Declaration
public override void OnLayoutDeserialize(XmlElement node)
Parameters
System.Xml.XmlElement
node
The Xml document node. |
Overrides
OnLayoutSerialize(XmlWriter)
Called when during windows layout serialization. Each window can use it to store custom interface data (eg. splitter position).
Declaration
public override void OnLayoutSerialize(XmlWriter writer)
Parameters
System.Xml.XmlWriter
writer
The Xml writer. |
Overrides
OnMouseDown(Float2, MouseButton)
When mouse goes down over control's area
Declaration
public override bool OnMouseDown(Float2 location, MouseButton button)
Parameters
Float2
location
Mouse location in Control Space |
MouseButton
button
Mouse buttons state (flags) |
Returns
System.Boolean
True if event has been handled, otherwise false |
Overrides
OnMouseUp(Float2, MouseButton)
When mouse goes up over control's area
Declaration
public override bool OnMouseUp(Float2 location, MouseButton button)
Parameters
Float2
location
Mouse location in Control Space |
MouseButton
button
Mouse buttons state (flags) |
Returns
System.Boolean
True if event has been handled, otherwise false |
Overrides
Open(ContentItem)
Opens the specified content item.
Declaration
public void Open(ContentItem item)
Parameters
FlaxEditor.Content.ContentItem
item
The content item. |
Paste(String[], Boolean)
Pastes the specified files.
Declaration
public void Paste(string[] files, bool isCutting)
Parameters
System.String[]
files
The files paths to import. |
System.Boolean
isCutting
Whether a cutting action is occuring. |
PerformLayoutBeforeChildren()
Perform layout for that container control before performing it for child controls.
Declaration
protected override void PerformLayoutBeforeChildren()
Overrides
RefreshView()
Refreshes the current view items collection.
Declaration
public void RefreshView()
RefreshView(ContentTreeNode)
Refreshes the view.
Declaration
public void RefreshView(ContentTreeNode target)
Parameters
ContentTreeNode
target
The target location. |
Rename(ContentItem)
Shows popup dialog with UI to rename content item.
Declaration
public void Rename(ContentItem item)
Parameters
FlaxEditor.Content.ContentItem
item
The item to rename. |
Rename(ContentItem, String)
Renames the specified item.
Declaration
public void Rename(ContentItem item, string newShortName)
Parameters
FlaxEditor.Content.ContentItem
item
The item. |
System.String
newShortName
New name (without extension, just the filename). |
ScrollingOnContentView(Boolean)
Enables or disables vertical and horizontal scrolling on the content view panel
Declaration
public void ScrollingOnContentView(bool enabled)
Parameters
System.Boolean
enabled
The state to set scrolling to |
ScrollingOnTreeView(Boolean)
Enables or disables vertical and horizontal scrolling on the content tree panel
Declaration
public void ScrollingOnTreeView(bool enabled)
Parameters
System.Boolean
enabled
The state to set scrolling to |
Select(ContentItem, Boolean)
Selects the specified item in the content view.
Declaration
public void Select(ContentItem item, bool fastScroll = false)
Parameters
FlaxEditor.Content.ContentItem
item
The item to select. |
System.Boolean
fastScroll
True of scroll to the item quickly without smoothing. |
Select(Asset)
Selects the specified asset in the content view.
Declaration
public void Select(Asset asset)
Parameters
Asset
asset
The asset to select. |
ShowRoot()
Shows the root folder.
Declaration
public void ShowRoot()
Update(Single)
Perform control update and all its children
Declaration
public override void Update(float deltaTime)
Parameters
System.Single
deltaTime
Delta time in seconds |
Overrides
Events
ContextMenuShow
Occurs when content window wants to show the context menu for the given content item. Allows to add custom options.
Declaration
public event Action<ContextMenu, ContentItem> ContextMenuShow
Event Type
System.Action<FlaxEditor.GUI.ContextMenu.ContextMenu, FlaxEditor.Content.ContentItem>
|