void RegisterContentItemTools()
        {
            DiagramStencil stencil = new DiagramStencil("CustomTools", "Content Item Tools");

            stencil.RegisterTool(new FactoryItemTool(
                                     "Text",
                                     () => "Text",
                                     diagram => new DiagramContentItem()
            {
                CustomStyleId = "formattedTextContentItem"
            },
                                     new Size(230, 110), true));
            stencil.RegisterTool(new FactoryItemTool(
                                     "Logo",
                                     () => "Logo",
                                     diagram => new DiagramContentItem()
            {
                CustomStyleId = "devExpressLogoContentItem",
            },
                                     new Size(230, 80), true));
            stencil.RegisterTool(new FactoryItemTool(
                                     "Action",
                                     () => "Button",
                                     diagram => new DiagramContentItem()
            {
                CustomStyleId = "buttonContentItem",
            },
                                     new Size(230, 80), true));
            DiagramToolboxRegistrator.RegisterStencil(stencil);
        }
        public void RegisterShapes()
        {
            DiagramControl.ItemTypeRegistrator.Register(typeof(DiagramShapeEx));
            var stencil = new DiagramStencil("customShapes", "Custom Shapes");

            stencil.RegisterTool(new FactoryItemTool("activeTaskShape", () => "Active Task", diagram => new DiagramShapeEx {
                Content = "Active Task", Status = Status.Active
            }, new System.Windows.Size(150, 100), false));
            stencil.RegisterTool(new FactoryItemTool("inactiveTaskShape", () => "Inactive Task", diagram => new DiagramShapeEx {
                Content = "Inactive Task", Status = Status.Inactive
            }, new System.Windows.Size(150, 100), false));
            DiagramToolboxRegistrator.RegisterStencil(stencil);
            diagramControl1.OptionsBehavior.SelectedStencils = StencilCollection.Parse("customShapes");
        }
예제 #3
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);
        }
예제 #4
0
        protected override void RegisterCustomToolboxItems()
        {
            var dashboardStencil = new DiagramStencil(OfficeStencilId, () => "Office Shapes");

            foreach (var tool in GetResourcesTools())
            {
                dashboardStencil.RegisterTool(tool);
            }
            DiagramToolboxRegistrator.RegisterStencil(dashboardStencil);
        }