本文整理汇总了C#中ITool.OnSelected方法的典型用法代码示例。如果您正苦于以下问题:C# ITool.OnSelected方法的具体用法?C# ITool.OnSelected怎么用?C# ITool.OnSelected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITool
的用法示例。
在下文中一共展示了ITool.OnSelected方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FinishCreating
public void FinishCreating()
{
ProcessMouseWithoutFocus = true;
textSurface.DefaultBackground = Settings.Color_MenuBack;
textSurface.DefaultForeground = Settings.Color_TitleText;
Clear();
_tools = new Dictionary<string, ITool>();
_tools.Add(PaintTool.ID, new PaintTool());
_tools.Add(RecolorTool.ID, new RecolorTool());
_tools.Add(FillTool.ID, new FillTool());
_tools.Add(TextTool.ID, new TextTool());
_tools.Add(LineTool.ID, new LineTool());
_tools.Add(BoxTool.ID, new BoxTool());
//_tools.Add(ObjectTool.ID, new ObjectTool());
_tools.Add(SelectionTool.ID, new SelectionTool());
_tools.Add(CircleTool.ID, new CircleTool());
_tools.Add(EntityCenterTool.ID, new EntityCenterTool());
_tools.Add(SceneEntityMoveTool.ID, new SceneEntityMoveTool());
FilesPanel = new FilesPanel();
ToolsPanel = new ToolsPanel();
LayersPanel = new LayersPanel();
FilesPanel.IsCollapsed = true;
LayersPanel.IsCollapsed = true;
ToolsPanel.ToolsListBox.SelectedItemChanged += (sender, e) =>
{
if (selectedTool != null)
{
selectedTool.OnDeselected();
if (selectedTool.ControlPanels != null)
foreach (var pane in selectedTool.ControlPanels)
{
foreach (var control in pane.Controls)
{
Remove(control);
}
}
}
if (e.Item != null)
{
selectedTool = (ITool)e.Item;
EditorConsoleManager.Instance.ToolName = selectedTool.Title;
EditorConsoleManager.Instance.AllowKeyboardToMoveConsole = true;
CommonCharacterPickerPanel.HideCharacter = false;
CommonCharacterPickerPanel.HideForeground = false;
CommonCharacterPickerPanel.HideBackground = false;
selectedTool.OnSelected();
CommonCharacterPickerPanel.Reset();
RefreshControls();
}
};
}