Exemplo n.º 1
0
        public void StartDragDrop()
        {
            var draggedItem = (DiagramShape)gridHitInfo.View.GetRow(gridHitInfo.RowHandle);
            var tool        = new FactoryItemTool("", () => "", diagram => new DiagramShape(draggedItem.Shape), new System.Windows.Size(150, 100));

            diagramControl1.Commands.Execute(DiagramCommandsBase.StartDragToolCommand, tool, null);
        }
Exemplo n.º 2
0
        void InitializeStencils()
        {
            DiagramStencil  myStencil       = new DiagramStencil("CustomStencil", "Custom Stencil");
            FactoryItemTool myContainerTool = new FactoryItemTool("Decoder", () => "Decoder", d => CreateDecoderContianer());

            myStencil.RegisterTool(myContainerTool);

            diagram.Stencils         = new DiagramStencilCollection(myStencil);
            diagram.SelectedStencils = new StencilCollection(myStencil.Id);
        }
Exemplo n.º 3
0
        void RegisterStencil()
        {
            var stencil  = new DevExpress.Diagram.Core.DiagramStencil("CustomStencil", "Custom Shapes");
            var itemTool = new FactoryItemTool("CustomShape", () => "Custom Shape", diagram => { DiagramShapeEx customShape = new DiagramShapeEx()
                                                                                                 {
                                                                                                     Width = 100, Height = 50
                                                                                                 }; return(customShape); }, new System.Windows.Size(100, 50), false);

            stencil.RegisterTool(itemTool);
            DevExpress.Diagram.Core.DiagramToolboxRegistrator.RegisterStencil(stencil);
            DiagramControl.ItemTypeRegistrator.Register(typeof(DiagramShapeEx));
        }