public virtual void AddDocument(DiagramDocument doc) { if (!this.myDocuments.Contains(doc)) { this.myDocuments.Add(doc); } }
public virtual void MergeLayersFrom(DiagramDocument other) { LayerCollectionEnumerator enumerator1 = other.Layers.GetEnumerator(); while (enumerator1.MoveNext()) { object obj1 = enumerator1.Current.Identifier; if ((obj1 != null) && (this.Layers.Find(obj1) == null)) { DiagramLayer layer2 = this.Layers.CreateNewLayerAfter(this.Layers.Top); layer2.Identifier = obj1; } } object obj2 = other.DefaultLayer.Identifier; DiagramLayer layer3 = this.Layers.Find(obj2); if (layer3 != null) { this.DefaultLayer = layer3; } }
protected virtual DataObject CreateDataObject(Shapes.IDiagramShapeCollection coll, DiagramDocument clipdoc) { DataObject obj1 = new DataObject(); obj1.SetData(clipdoc.DataFormat, clipdoc); Bitmap bitmap1 = this.GetBitmapFromCollection(clipdoc); obj1.SetData(DataFormats.Bitmap, true, bitmap1); string text1 = null; LayerCollectionObjectEnumerator enumerator1 = clipdoc.GetEnumerator(); while (enumerator1.MoveNext()) { Shapes.DiagramShape obj2 = enumerator1.Current; Shapes.ITextNode node1 = obj2 as Shapes.ITextNode; if (node1 != null) { if (text1 == null) { text1 = node1.Text; continue; } text1 = text1 + Environment.NewLine + node1.Text; continue; } Shapes.DiagramText text2 = obj2 as Shapes.DiagramText; if (text2 != null) { if (text1 == null) { text1 = text2.Text; continue; } text1 = text1 + Environment.NewLine + text2.Text; } } if (text1 != null) { obj1.SetData(DataFormats.UnicodeText, true, text1); } return obj1; }
private void init(DiagramDocument doc) { //modified by little //this.myCurrentResult = (GoViewLicenseProvider.GoViewLicense) LicenseManager.Validate(typeof(DiagramView), this); this.myDocChangedEventHandler = new ChangedEventHandler(this.SafeOnDocumentChanged); this.myDocument = doc; this.myLayers = new LayerCollection(); this.myLayers.init(this); if (this.myDocument == null) { this.myDocument = this.CreateDocument(); } this.myDocument.Changed += this.myDocChangedEventHandler; this.InitializeLayersFromDocument(); this.mySelection = this.CreateSelection(); this.myDefaultTool = this.CreateDefaultTool(); this.myTool = this.DefaultTool; this.myTool.Start(); base.SetStyle(ControlStyles.AllPaintingInWmPaint | (ControlStyles.ResizeRedraw | (ControlStyles.Opaque | ControlStyles.UserPaint)), true); this.myVertScroll = new VScrollBar(); this.myHorizScroll = new HScrollBar(); this.myCorner = new Control(); this.myCorner.BackColor = SystemColors.Control; base.Controls.Add(this.myVertScroll); base.Controls.Add(this.myHorizScroll); base.Controls.Add(this.myCorner); this.myVertScroll.SmallChange = this.ScrollSmallChange.Height; this.myHorizScroll.SmallChange = this.ScrollSmallChange.Width; this.myToolTip = new System.Windows.Forms.ToolTip(); this.myVertScrollHandler = new ScrollEventHandler(this.HandleScroll); this.myVertScroll.Scroll += this.myVertScrollHandler; this.myHorizScrollHandler = new ScrollEventHandler(this.HandleScroll); this.myHorizScroll.Scroll += this.myHorizScrollHandler; this.myVertScroll.RightToLeft = RightToLeft.No; this.myHorizScroll.RightToLeft = RightToLeft.No; this.InitAllowDrop(true); this.BackColor = Color.White; this.Document.ShapeAdded += new SelectionEventHandler(DefaultLayer_ShapeAdded); this.Document.ShapeRemoved += new SelectionEventHandler(DefaultLayer_ShapeRemoved); }
public DiagramView(DiagramDocument doc) { this.myVertScroll = null; this.myHorizScroll = null; this.myScrollBarWidth = SystemInformation.VerticalScrollBarWidth; this.myScrollBarHeight = SystemInformation.HorizontalScrollBarHeight; this.myVertScrollHandler = null; this.myHorizScrollHandler = null; this.myVertScrollVisibility = DiagramViewScrollBarVisibility.Auto; this.myHorizScrollVisibility = DiagramViewScrollBarVisibility.Auto; this.myCorner = null; this.mySafeOnDocumentChangedDelegate = null; this.myQueuedEvents = null; this.myAllowDragOut = true; this.myExternalDragImage = null; this.myPretendInternalDrag = false; this.myExternalDragDropsOnEnter = false; this.myGraphics = null; this.myPaintEventArgs = null; this.mySuppressPaint = 0; this.myUpdatingScrollBars = true; this.myAutoScrollRegion = new Size(SystemInformation.VerticalScrollBarWidth, SystemInformation.HorizontalScrollBarHeight); this.myAutoScrollTime = 100; this.myAutoScrollDelay = 1000; this.myAutoScrollTimer = null; this.myAutoScrollTimerEnabled = false; this.myAutoScrollPoint = new Point(); this.myPanning = false; this.myPanningOrigin = new Point(); this.myToolTip = null; this.myDefaultCursor = null; this.myHoverTimer = null; this.myHoverTimerEnabled = false; this.myHoverDelay = 1000; this.myHoverPoint = new Point(0, 0); this.myPrintInfo = null; this.myPrintScale = 0.8f; this.myPrevXorRect = new Rectangle(); this.myPrevXorRectValid = false; this.myEditControl = null; this.myGoControls = null; this.myModalControl = null; this.myCancelMouseDown = false; this.myImageList = null; this.myBorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.myBorder3DStyle = System.Windows.Forms.Border3DStyle.Etched; this.myBorderSize = SystemInformation.Border3DSize; this.myDocument = null; this.myDocChangedEventHandler = null; this.mySelection = null; this.myMaximumSelectionCount = 1000000; this.myPrimarySelectionColor = Color.Chartreuse; this.mySecondarySelectionColor = Color.Cyan; this.myNoFocusSelectionColor = Color.LightGray; this.myResizeHandleSize = new SizeF(6f, 6f); this.myResizeHandlePenWidth = 1f; this.myBoundingHandlePenWidth = 2f; this.myHidesSelection = false; this.mySelectsByFirstChar = true; this.myLayers = null; this.myScrollSmallChange = new Size(0x10, 0x10); this.myAutoPanRegion = new Size(0x10, 0x10); this.myShowsNegativeCoordinates = true; this.myOrigin = new PointF(); this.myHorizScale = 1f; this.myVertScale = 1f; this.myHorizWorld = 1f; this.myVertWorld = 1f; this.mySmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; this.myTextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; this.myInterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High; this.myAllowSelect = true; this.myAllowMove = true; this.myAllowCopy = true; this.myAllowResize = true; this.myAllowReshape = true; this.myAllowDelete = true; this.myAllowInsert = true; this.myAllowLink = true; this.myAllowEdit = true; this.myAllowMouse = true; this.myAllowKey = true; this.myCurrentResult = null; this.myBuffer = null; this.myTempArrays = null; this.myFirstInput = new InputEventArgs(); this.myLastInput = new InputEventArgs(); this.myTool = null; this.myDefaultTool = null; this.myMouseDownTools = null; this.myMouseMoveTools = null; this.myMouseUpTools = null; this.myDragsRealtime = false; this.myPortGravity = 100f; this._LineType = typeof(Shapes.LineGraph); this.myBackgroundBrush = null; this.myGridStyle = DiagramViewGridStyle.None; this.myGridOrigin = new PointF(); this.myGridCellSize = new SizeF(50f, 50f); this.myGridColor = Color.LightGray; this.myGridPen = null; this.myGridPenWidth = 1f; this.myGridPenDashStyle = DashStyle.Solid; this.mySnapDrag = DiagramViewSnapStyle.None; this.mySnapResize = DiagramViewSnapStyle.None; this.myShadowOffset = new SizeF(5f, 5f); this.myShadowColor = Color.FromArgb(0x7f, Color.Gray); this.myShadowBrush = null; this.myShadowPen = null; this.myPaintNothingScale = 0.13f; this.myPaintGreekScale = 0.24f; this.init(doc); }
public virtual void RemoveDocument(DiagramDocument doc) { this.myDocuments.Remove(doc); }