public void Load(string filename) { using (var stream = File.OpenRead(filename)) { Document = DiagramDocument.Load(stream); AfterAction(true); } }
public DiagramControl() { _mainLayer = Layers[0]; // predefined _mainLayer.Shapes = new MSet <LLShape> { _shapeGroup }; _selAdornerLayer = AddLayerAbove(_mainLayer, false); _selAdornerLayer.Shapes = new MSet <LLShape> { _selAdornerGroup }; _dragAdornerLayer = AddLayerAbove(_selAdornerLayer, false); _dragAdornerLayer.Shapes = new MSet <LLShape> { _dragAdornerGroup }; _shapeGroup.Transform = _scrollZoom; _selAdornerGroup.Transform = _scrollZoom; _dragAdornerGroup.Transform = _scrollZoom; _gestureAnalyzer = new DiagramGestureAnalyzer(this); Document = new DiagramDocument(); LineStyle = new DiagramDrawStyle { LineColor = Color.Black, LineWidth = 2, TextColor = Color.Blue, FillColor = Color.FromArgb(64, Color.Gray) }; LineStyle.Name = "Default"; BoxStyle = (DiagramDrawStyle)LineStyle.Clone(); BoxStyle.LineColor = Color.DarkGreen; MarkerRadius = 5; MarkerType = MarkerPolygon.Circle; FromArrow = null; ToArrow = Arrowhead.Arrow30deg; }
public DiagramControl() { _mainLayer = Layers[0]; // predefined _mainLayer.Shapes = new MSet<LLShape> { _shapeGroup }; _selAdornerLayer = AddLayerAbove(_mainLayer, false); _selAdornerLayer.Shapes = new MSet<LLShape> { _selAdornerGroup }; _dragAdornerLayer = AddLayerAbove(_selAdornerLayer, false); _dragAdornerLayer.Shapes = new MSet<LLShape> { _dragAdornerGroup }; _shapeGroup.Transform = _scrollZoom; _selAdornerGroup.Transform = _scrollZoom; _dragAdornerGroup.Transform = _scrollZoom; _gestureAnalyzer = new DiagramGestureAnalyzer(this); Document = new DiagramDocument(); LineStyle = new DiagramDrawStyle { LineColor = Color.Black, LineWidth = 2, TextColor = Color.Blue, FillColor = Color.FromArgb(64, Color.Gray) }; LineStyle.Name = "Default"; BoxStyle = (DiagramDrawStyle)LineStyle.Clone(); BoxStyle.LineColor = Color.DarkGreen; MarkerRadius = 5; MarkerType = MarkerPolygon.Circle; FromArrow = null; ToArrow = Arrowhead.Arrow30deg; }
public DDUndoStack(DiagramDocument self) { _self = self; }