本文整理汇总了C#中ICanvas.GetProperties方法的典型用法代码示例。如果您正苦于以下问题:C# ICanvas.GetProperties方法的具体用法?C# ICanvas.GetProperties怎么用?C# ICanvas.GetProperties使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ICanvas
的用法示例。
在下文中一共展示了ICanvas.GetProperties方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Add
public static string Add(ICanvas canvas)
{
var history = Get(canvas);
var undo = history.Undo;
var redo = history.Redo;
var model = ModelEditor.GenerateDiagram(canvas, null, canvas.GetProperties());
undo.Push(model);
redo.Clear();
NotifyCanvasHistoryChanged(new CanvasHistoryChangedEventArgs()
{
Canvas = canvas,
Undo = undo,
Redo = redo
});
return model;
}
示例2: IsTagInputOrOutput
private TagDragAndDropType IsTagInputOrOutput(ICanvas canvas, IPoint point)
{
if (point.X < (double)canvas.GetProperties().PageWidth / 2.0)
return TagDragAndDropType.Input;
else
return TagDragAndDropType.Output;
}
示例3: DxfExportDiagram
private void DxfExportDiagram(string fileName,
ICanvas canvas,
bool shortenStart,
bool shortenEnd,
DxfAcadVer version,
DiagramTable table)
{
string model = ModelEditor.GenerateDiagram(canvas, null, canvas.GetProperties());
string dxf = DxfGenerate(model, shortenStart, shortenEnd, version, table);
DxfSave(fileName, dxf);
}
示例4: Undo
public static void Undo(ICanvas canvas, IDiagramCreator creator, bool pushRedo)
{
var history = Get(canvas);
var undo = history.Undo;
var redo = history.Redo;
if (undo.Count <= 0)
return;
// save current model
if (pushRedo == true)
{
var current = ModelEditor.GenerateDiagram(canvas, null, canvas.GetProperties());
redo.Push(current);
}
// restore previous model
var model = undo.Pop();
ModelEditor.Clear(canvas);
ModelEditor.Parse(model,
canvas, creator,
0, 0,
false, true, false, true);
NotifyCanvasHistoryChanged(new CanvasHistoryChangedEventArgs()
{
Canvas = canvas,
Undo = undo,
Redo = redo
});
}
示例5: SaveDiagram
public void SaveDiagram(string fileName, ICanvas canvas)
{
ModelEditor.Save(fileName, ModelEditor.GenerateDiagram(canvas, null, canvas.GetProperties()));
}
示例6: MoveUp
public void MoveUp(ICanvas canvas)
{
Snapshot(canvas, false);
MoveSelectedElements(canvas, 0.0, Context.EnableSnap ? -canvas.GetProperties().GridSize : -1.0, false);
}
示例7: SwitchItems
public static TreeItemType SwitchItems(ICanvas canvas,
IDiagramCreator creator,
ITreeItem oldItem,
ITreeItem newItem,
Action<DiagramProperties> setProperties)
{
if (newItem == null)
return TreeItemType.None;
var oldItemType = GetTreeItemType(oldItem == null ? null : oldItem.GetUid());
var newItemType = GetTreeItemType(newItem == null ? null : newItem.GetUid());
if (oldItemType == TreeItemType.Diagram)
ModelEditor.Store(canvas, oldItem);
if (newItemType == TreeItemType.Diagram)
{
ModelEditor.Load(canvas, creator, newItem);
if (setProperties != null)
setProperties(canvas.GetProperties());
}
return newItemType;
}