本文整理汇总了C#中ITool类的典型用法代码示例。如果您正苦于以下问题:C# ITool类的具体用法?C# ITool怎么用?C# ITool使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITool类属于命名空间,在下文中一共展示了ITool类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MultiLineTextTool
public MultiLineTextTool (IDrawingEditor editor, MultiLineTextFigure fig, ITool dt): base (editor, fig, dt) {
_textview = new Gtk.TextView ();
_textview.Buffer.Changed += new System.EventHandler (ChangedHandler);
_textview.ModifyFont (fig.PangoLayout.FontDescription.Copy ());
_textview.RightMargin = 5;
_textview.Justification = ConvertJustificaton ();
}
示例2: PopupMenuTool
public PopupMenuTool(IDrawingEditor editor, IPopupMenuFigure figure, ITool defaultTool, ITool delegateTool, bool mainMenu)
: base(editor, figure, defaultTool)
{
_figure = figure;
DelegateTool = delegateTool;
primaryMenu = mainMenu;
}
示例3: ToolDialog
/// <summary>
/// The constructor for the ToolDialog
/// </summary>
/// <param name="tool">The ITool to create the dialog box for</param>
/// <param name="modelElements">A list of all model elements</param>
public ToolDialog(ITool tool, IEnumerable<ModelElement> modelElements)
{
// Required by the designer
InitializeComponent();
// We store all the element names here and extract the datasets
foreach (ModelElement me in modelElements)
{
if (me as DataElement != null)
{
bool addData = true;
foreach (Parameter par in tool.OutputParameters)
{
if (par.ModelName == (me as DataElement).Parameter.ModelName)
{
addData = false;
}
break;
}
if (addData)
{
_dataSets.Add(new DataSetArray(me.Name, (me as DataElement).Parameter.Value as IDataSet));
}
}
}
Initialize(tool);
}
示例4: InsertTool
private void InsertTool(ITool tool)
{
// Create the view.
var view = tool.CreateView();
if (view.DataContext == null) view.DataContext = tool;
view.HorizontalAlignment = tool.HorizontalAlignment;
view.VerticalAlignment = tool.VerticalAlignment;
// Assign the margin (if the generated view did not arrive with an explicitly set value).
if (view.Margin == default(Thickness)) view.Margin = tool.Parent.DefaultToolMargin;
// Get the column (and update it's width if required).
var columnIndex = tool.Parent.GetColumn(tool);
if (tool is IGridCellWidth)
{
toolContainer.ColumnDefinitions[columnIndex].Width = ((IGridCellWidth) tool).ColumnWidth;
}
// Assign Row/Column position.
Grid.SetRow(view, tool.Parent.GetRow(tool));
Grid.SetColumn(view, columnIndex);
// Set spans.
Grid.SetRowSpan(view, tool.Parent.GetRowSpan(tool));
Grid.SetColumnSpan(view, tool.Parent.GetColumnSpan(tool));
// Insert into the visual tree.
toolContainer.Children.Add(view);
}
示例5: GetOrAddToolSchedule
private IActivityToolSchedulingEventCollection GetOrAddToolSchedule(ITool tool)
{
if (!_toolSchedules.ContainsKey(tool))
{
_toolSchedules.Add(tool, new ActivityToolSchedulingEventCollection(tool));
}
return _toolSchedules[tool];
}
示例6: Pickup
public Pickup(int x, int y, ITool tool, string text)
{
Tool = tool;
this.text = text;
X = x;
startY = Y = y;
Size = new Point(16, 16);
}
示例7: SimpleTextTool
public SimpleTextTool (IDrawingEditor editor, SimpleTextFigure fig, ITool dt)
: base (editor, fig, dt) {
_entry = new Gtk.Entry ();
_entry.HasFrame = false;
_entry.Alignment = 0.5f;
_entry.Changed += new System.EventHandler (ChangedHandler);
_entry.ModifyFont (fig.PangoLayout.FontDescription.Copy ());
}
示例8: Inventory
public Inventory(int x, int y, ITool[] tools)
: this(x, y)
{
foreach (ITool tool in tools)
{
this.tools.Add(tool);
}
}
示例9: ToolDialog
/// <summary>
/// The constructor for the ToolDialog
/// </summary>
/// <param name="Tool">The ITool to create the dialog box for</param>
/// <param name="DataSets">The list of available DataSets available</param>
public ToolDialog(ITool Tool, List<DataSetArray> DataSets)
{
//Required by the designer
InitializeializeializeComponent();
_dataSets = DataSets;
Initialize(Tool);
}
示例10: ToolInstance
private ToolInstance(int id, ITool definition) : this()
{
if (id == -1)
{
id = this.NextId();
}
ID = id;
Definition = definition;
}
示例11: Show
public void Show(ITool tool, Action applyCallback, Action cancelCallback)
{
this.Content = tool.GetSettingsUI();
this.Header = tool.ToString().Split('.').Last();
if (!this.IsOpen && this.Content != null)
{
this.Show();
}
}
示例12: AddPlugin
private void AddPlugin(ITool plugin)
{
var tabitem = new TabItem
{
Header = plugin.Name,
Content = plugin.View
};
tabControl.Items.Add(tabitem);
}
示例13: TinyDiver
public TinyDiver(ITool tool1, ITool tool2, int x, int y)
: base(tool1, tool2, x, y)
{
Size = new Point(16, 28);
StandingGrid = new SpriteGrid("tiny_standing", 2, 1);
WalkingGrid = new SpriteGrid("tiny_walking", 12, 1);
JumpingGrid = new SpriteGrid("tiny_jumping", 6, 1);
ClimbingGrid = new SpriteGrid("tiny_climbing", 2, 1);
Name = "Tiny";
originalBoatPosition = new Point(250, 224 - Height);
}
示例14: SetCurrentTool
public static void SetCurrentTool(ITool tool)
{
if (currentTool != null)
{
currentTool.OnRemove();
}
currentTool = tool;
currentTool.OnAdd();
}
示例15: CreateObject
private void CreateObject(ITool tool)
{
using ( var scope = RecordingServices.DefaultRecorder.OpenScope() )
{
var newItem = tool.CreateItem( EditingContext );
newItem.SetPosition( 100, 100 );
// We name the scope after we created.
scope.OperationDescriptor = new NamedOperationDescriptor(string.Format("Creating {0}", newItem.Name));
}
}