当前位置: 首页>>代码示例>>C#>>正文


C# ICanvas.GetProperties方法代码示例

本文整理汇总了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;
        }
开发者ID:elsiete,项目名称:CanvasDiagramEditor,代码行数:20,代码来源:HistoryEditor.cs

示例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;
 }
开发者ID:elsiete,项目名称:CanvasDiagramEditor,代码行数:7,代码来源:DiagramControl.xaml.cs

示例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);
        }
开发者ID:elsiete,项目名称:CanvasDiagramEditor,代码行数:13,代码来源:MainWindow.xaml.cs

示例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
            });
        }
开发者ID:elsiete,项目名称:CanvasDiagramEditor,代码行数:32,代码来源:HistoryEditor.cs

示例5: SaveDiagram

 public void SaveDiagram(string fileName, ICanvas canvas)
 {
     ModelEditor.Save(fileName, ModelEditor.GenerateDiagram(canvas, null, canvas.GetProperties()));
 }
开发者ID:elsiete,项目名称:CanvasDiagramEditor,代码行数:4,代码来源:DiagramEditor.cs

示例6: MoveUp

 public void MoveUp(ICanvas canvas)
 {
     Snapshot(canvas, false);
     MoveSelectedElements(canvas, 0.0, Context.EnableSnap ? -canvas.GetProperties().GridSize : -1.0, false);
 }
开发者ID:elsiete,项目名称:CanvasDiagramEditor,代码行数:5,代码来源:DiagramEditor.cs

示例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;
        }
开发者ID:elsiete,项目名称:CanvasDiagramEditor,代码行数:25,代码来源:TreeEditor.cs


注:本文中的ICanvas.GetProperties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。