-
Notifications
You must be signed in to change notification settings - Fork 2
/
Form1.cs
35 lines (32 loc) · 1.19 KB
/
Form1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.Diagram.Core;
using DevExpress.Diagram.Core.Shapes;
using System.Windows;
using System.IO;
using System.Reflection;
namespace XtraDiagram.CreateCustomShapes {
public partial class Form1 : DevExpress.XtraBars.Ribbon.RibbonForm {
public Form1() {
InitializeComponent();
RegisterCustomShapes();
this.diagramControl1.SelectedStencils = new StencilCollection(new string[] { "CustomShapes" });
}
protected override void OnLoad(EventArgs e) {
base.OnLoad(e);
this.diagramControl1.InitializeRibbon(this.ribbonControl1);
}
void RegisterCustomShapes() {
using(var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("XtraDiagram.CreateCustomShapes.CustomShapes.xml")) {
var stencil = DiagramStencil.Create("CustomShapes", "Custom Shapes", stream, shapeName => shapeName);
DiagramToolboxRegistrator.RegisterStencil(stencil);
}
}
}
}