public virtual void Add(DiagramShape obj) { if ((obj != null) && !this.Contains(obj)) { this.myObjects.Add(obj); } }
public override void AddSelectionHandles(DiagramSelection sel, DiagramShape selectedObj) { base.AddSelectionHandles(sel, selectedObj); if (this.CanReshape() && this.ResizableRadius) { RectangleF ef1 = this.Bounds; PointF tf1 = new PointF(); float single1 = this.MinorRadius; if (this.Orientation == System.Windows.Forms.Orientation.Vertical) { if ((this.Perspective == Perspective.TopLeft) || (this.Perspective == Perspective.TopRight)) { tf1 = new PointF(ef1.X + (ef1.Width / 2f), ef1.Y + (2f * single1)); } else { tf1 = new PointF(ef1.X + (ef1.Width / 2f), (ef1.Y + ef1.Height) - (2f * single1)); } } else if ((this.Perspective == Perspective.TopLeft) || (this.Perspective == Perspective.BottomLeft)) { tf1 = new PointF(ef1.X + (2f * single1), ef1.Y + (ef1.Height / 2f)); } else { tf1 = new PointF((ef1.X + ef1.Width) - (2f * single1), ef1.Y + (ef1.Height / 2f)); } IShapeHandle handle1 = sel.CreateResizeHandle(this, selectedObj, tf1, 0x408, true); base.MakeDiamondResizeHandle(handle1, (this.Orientation == System.Windows.Forms.Orientation.Horizontal) ? 0x40 : 0x80); } }
public virtual void AddSelectionHandles(DiagramSelection sel, DiagramShape selectedObj) { this.RemoveSelectionHandles(sel); if (!this.CanResize()) { sel.CreateBoundingHandle(this, selectedObj); } else { RectangleF ef1 = this.Bounds; float single1 = ef1.X; float single2 = ef1.X + (ef1.Width / 2f); float single3 = ef1.X + ef1.Width; float single4 = ef1.Y; float single5 = ef1.Y + (ef1.Height / 2f); float single6 = ef1.Y + ef1.Height; sel.CreateResizeHandle(this, selectedObj, new PointF(single1, single4), 2, true); sel.CreateResizeHandle(this, selectedObj, new PointF(single3, single4), 4, true); sel.CreateResizeHandle(this, selectedObj, new PointF(single3, single6), 8, true); sel.CreateResizeHandle(this, selectedObj, new PointF(single1, single6), 0x10, true); if (this.CanReshape()) { sel.CreateResizeHandle(this, selectedObj, new PointF(single2, single4), 0x20, true); sel.CreateResizeHandle(this, selectedObj, new PointF(single3, single5), 0x40, true); sel.CreateResizeHandle(this, selectedObj, new PointF(single2, single6), 0x80, true); sel.CreateResizeHandle(this, selectedObj, new PointF(single1, single5), 0x100, true); } } }
public override void CopyObjectDelayed(CopyDictionary env, DiagramShape newobj) { base.CopyObjectDelayed(env, newobj); Balloon balloon1 = (Balloon)newobj; balloon1.myAnchor = env[this.myAnchor] as DiagramShape; balloon1.LayoutChildren(null); }
public virtual bool Contains(DiagramShape obj) { if (obj == null) { return false; } return this.myObjects.Contains(obj); }
public override void AddSelectionHandles(DiagramSelection sel, DiagramShape selectedObj) { if (!this.CanResize() || !this.CanReshape()) { base.AddSelectionHandles(sel, selectedObj); } else { System.Windows.Forms.Orientation orientation1 = this.Orientation; PointF tf2 = new PointF(); PointF tf3 = new PointF(); PointF tf4 = new PointF(); PointF tf5 = new PointF(); bool flag1 = this.A.X <= this.B.X; bool flag2 = this.A.Y <= this.D.Y; sel.RemoveHandles(this); if (flag1 && flag2) { tf2 = this.A; tf3 = this.B; tf4 = this.D; tf5 = this.C; } else if (!flag1 && flag2) { tf2 = this.B; tf3 = this.A; tf4 = this.C; tf5 = this.D; } else if (flag1 && !flag2) { tf2 = this.D; tf3 = this.C; tf4 = this.A; tf5 = this.B; } else { tf2 = this.C; tf3 = this.D; tf4 = this.B; tf5 = this.A; } PointF tf1 = new PointF((tf2.X + tf4.X) / 2f, (tf2.Y + tf4.Y) / 2f); sel.CreateResizeHandle(this, selectedObj, tf1, 0x100, true); tf1 = new PointF((tf3.X + tf5.X) / 2f, (tf3.Y + tf5.Y) / 2f); sel.CreateResizeHandle(this, selectedObj, tf1, 0x40, true); tf1 = new PointF((tf2.X + tf3.X) / 2f, (tf2.Y + tf3.Y) / 2f); sel.CreateResizeHandle(this, selectedObj, tf1, 0x20, true); tf1 = new PointF((tf4.X + tf5.X) / 2f, (tf4.Y + tf5.Y) / 2f); sel.CreateResizeHandle(this, selectedObj, tf1, 0x80, true); sel.CreateResizeHandle(this, selectedObj, this.A, 0x40a, true); sel.CreateResizeHandle(this, selectedObj, this.B, 0x40b, true); sel.CreateResizeHandle(this, selectedObj, this.C, 0x40c, true); sel.CreateResizeHandle(this, selectedObj, this.D, 0x40d, true); } }
public override void Add(DiagramShape obj) { if ((this.Handle != null) && (this.Count >= 1)) { this.InsertBefore(this.Handle, obj); } else { base.Add(obj); } }
public override void AddSelectionHandles(DiagramSelection sel, DiagramShape selectedObj) { base.AddSelectionHandles(sel, selectedObj); if (this.CanReshape() && this.ReshapableDepth) { RectangleF ef1 = this.Bounds; PointF tf1 = new PointF(); SizeF ef2 = this.Depth; tf1 = this.getPoints(0f, 0f)[1]; IShapeHandle handle1 = sel.CreateResizeHandle(this, selectedObj, tf1, 0x409, true); base.MakeDiamondResizeHandle(handle1, 1); } }
public override void AddSelectionHandles(DiagramSelection sel, DiagramShape selectedObj) { base.AddSelectionHandles(sel, selectedObj); if (this.CanReshape() && this.ReshapableCorner) { RectangleF ef1 = this.Bounds; PointF tf1 = new PointF(ef1.X + this.Corner.Width, ef1.Y); IShapeHandle handle1 = sel.CreateResizeHandle(this, selectedObj, tf1, 1030, true); base.MakeDiamondResizeHandle(handle1, 0x40); tf1 = new PointF(ef1.X, ef1.Y + this.Corner.Height); handle1 = sel.CreateResizeHandle(this, selectedObj, tf1, 0x407, true); base.MakeDiamondResizeHandle(handle1, 0x80); } }
public override void AddSelectionHandles(DiagramSelection sel, DiagramShape selectedObj) { if (!this.CanResize() || !this.CanReshape()) { base.AddSelectionHandles(sel, selectedObj); } else { sel.RemoveHandles(this); sel.CreateResizeHandle(this, selectedObj, this.A, 0x2000, true); sel.CreateResizeHandle(this, selectedObj, this.B, 0x2001, true); sel.CreateResizeHandle(this, selectedObj, this.C, 0x2002, true); } }
public virtual void AddObserver(DiagramShape obj) { if (obj != null) { if (this.myObservers == null) { this.myObservers = new DiagramShapeCollection(); } if (!this.myObservers.Contains(obj)) { this.myObservers.Add(obj); this.Changed(0x3f6, 0, null, DiagramShape.NullRect, 0, obj, DiagramShape.NullRect); } } }
public override void AddSelectionHandles(DiagramSelection sel, DiagramShape selectedObj) { sel.RemoveHandles(this); if (this.BackgroundOpaqueWhenSelected) { bool flag1 = base.SkipsUndoManager; base.SkipsUndoManager = true; this.TransparentBackground = false; base.SkipsUndoManager = flag1; } else { base.AddSelectionHandles(sel, selectedObj); } }
public override void AddSelectionHandles(DiagramSelection sel, DiagramShape selectedObj) { base.AddSelectionHandles(sel, selectedObj); if (this.CanReshape() && this.ReshapableCorner) { RectangleF ef1 = this.Bounds; bool flag1 = this.Orientation == System.Windows.Forms.Orientation.Horizontal; float single1 = this.DistanceLeft; float single2 = this.DistanceRight; float single3 = this.DistanceTop; float single4 = this.DistanceBottom; bool flag2 = false; bool flag3 = false; this.DetermineReshapeBehavior(ref flag2, ref flag3); PointF[] tfArray1 = this.getPoints(); PointF tf1 = new PointF(); if (flag1) { tf1 = tfArray1[1]; } else { tf1 = tfArray1[5]; } IShapeHandle handle1 = sel.CreateResizeHandle(this, selectedObj, tf1, 0x402, true); base.MakeDiamondResizeHandle(handle1, flag1 ? 0x40 : 0x80); tf1 = tfArray1[0]; handle1 = sel.CreateResizeHandle(this, selectedObj, tf1, 0x404, true); base.MakeDiamondResizeHandle(handle1, flag3 ? (flag1 ? 0x40 : 0x80) : 1); if (!flag2) { if (flag1) { tf1 = tfArray1[4]; } else { tf1 = tfArray1[2]; } handle1 = sel.CreateResizeHandle(this, selectedObj, tf1, 0x403, true); base.MakeDiamondResizeHandle(handle1, flag1 ? 0x40 : 0x80); tf1 = tfArray1[3]; handle1 = sel.CreateResizeHandle(this, selectedObj, tf1, 0x405, true); base.MakeDiamondResizeHandle(handle1, flag3 ? (flag1 ? 0x40 : 0x80) : 1); } } }
public virtual void Add(DiagramShape obj) { if (obj != null) { GroupShape group1 = obj.Parent; if (group1 == null) { if (obj.Layer != null) { throw new ArgumentException("Cannot add an object to a group when it is already part of a document or view."); } this.insertAt(this.myObjects.Count, obj, false); } else if (group1 != this) { throw new ArgumentException("Cannot move an object from one group to another without first removing it from its parent."); } } }
public override void AddSelectionHandles(DiagramSelection sel, DiagramShape selectedObj) { base.AddSelectionHandles(sel, selectedObj); if (this.CanReshape() && this.ReshapableSkew) { RectangleF ef1 = this.Bounds; SizeF ef2 = this.Skew; PointF tf1 = new PointF(); if (this.Direction) { tf1 = new PointF(ef1.X + ef2.Width, ef1.Y + ef2.Height); } else { tf1 = new PointF((ef1.X + ef1.Width) - ef2.Width, ef1.Y + ef2.Height); } IShapeHandle handle1 = sel.CreateResizeHandle(this, selectedObj, tf1, 0x40e, true); base.MakeDiamondResizeHandle(handle1, 1); } }
public override void AddSelectionHandles(DiagramSelection sel, DiagramShape selectedObj) { base.AddSelectionHandles(sel, selectedObj); if (this.CanReshape()) { if (this.ResizableStartAngle) { RectangleF ef1 = this.Bounds; PointF tf1 = this.GetPointAtAngle(this.StartAngle); IShapeHandle handle1 = sel.CreateResizeHandle(this, selectedObj, tf1, 0x40f, true); base.MakeDiamondResizeHandle(handle1, 1); } if (this.ResizableEndAngle) { RectangleF ef2 = this.Bounds; PointF tf2 = this.GetPointAtAngle(this.StartAngle + this.SweepAngle); IShapeHandle handle2 = sel.CreateResizeHandle(this, selectedObj, tf2, 1040, true); base.MakeDiamondResizeHandle(handle2, 1); } } }
protected virtual void OnObservedChanged(DiagramShape observed, int subhint, int oldI, object oldVal, RectangleF oldRect, int newI, object newVal, RectangleF newRect) { }
protected virtual void OnLayerChanged(DiagramLayer oldlayer, DiagramLayer newlayer, DiagramShape mainObj) { }
public bool IsChildOf(DiagramShape obj) { if (obj is GroupShape) { for (GroupShape group1 = this.Parent; group1 != null; group1 = group1.Parent) { if (group1 == obj) { return true; } } } return false; }
public static DiagramShape FindCommonParent(DiagramShape a, DiagramShape b) { if (a == b) { return a; } if (b != null) { for (DiagramShape obj1 = a; obj1 != null; obj1 = obj1.Parent) { for (DiagramShape obj2 = b; obj2 != null; obj2 = obj2.Parent) { if (obj2 == obj1) { return obj2; } } } } return null; }
public virtual void CopyObjectDelayed(CopyDictionary env, DiagramShape newobj) { CollectionEnumerator enumerator1 = this.Observers.GetEnumerator(); while (enumerator1.MoveNext()) { DiagramShape obj1 = enumerator1.Current; DiagramShape obj2 = env[obj1] as DiagramShape; newobj.AddObserver(obj2); } }
public void SetSpotLocation(int spot, DiagramShape obj, int otherSpot) { PointF tf1 = obj.GetSpotLocation(otherSpot); this.SetSpotLocation(spot, tf1); }
internal void SetLayer(DiagramLayer value, DiagramShape mainObj, bool undoing) { GroupShape group1 = this as GroupShape; if (group1 != null) { DiagramShape[] objArray1 = group1.CopyArray(); for (int num1 = 0; num1 < objArray1.Length; num1++) { DiagramShape obj1 = objArray1[num1]; obj1.SetLayer(value, mainObj, undoing); } } DiagramLayer layer1 = this.myLayer; DiagramLayer layer2 = value; if (layer1 != layer2) { if (layer2 == null) { if (!undoing) { this.OnLayerChanged(layer1, null, mainObj); } this.myLayer = null; } else { this.myLayer = layer2; if (!undoing) { this.OnLayerChanged(layer1, layer2, mainObj); } } } }
public virtual void RemoveObserver(DiagramShape obj) { if ((obj != null) && ((this.myObservers != null) && this.myObservers.Contains(obj))) { this.myObservers.Remove(obj); this.Changed(0x3f7, 0, obj, DiagramShape.NullRect, 0, null, DiagramShape.NullRect); } }
public override void LayoutChildren(DiagramShape childchanged) { if (!base.Initializing) { DiagramText text1 = this.Label; if (text1 != null) { DiagramShape obj1 = this.Background; if (obj1 != null) { SizeF ef1 = this.TopLeftMargin; SizeF ef2 = this.BottomRightMargin; if (this.AutoResizes) { obj1.Bounds = new RectangleF(text1.Left - ef1.Width, text1.Top - ef1.Height, (text1.Width + ef1.Width) + ef2.Width, (text1.Height + ef1.Height) + ef2.Height); } else { float single1 = System.Math.Max((float)(obj1.Width - (ef1.Width + ef2.Width)), (float)0f); float single2 = System.Math.Max((float)(obj1.Height - (ef1.Height + ef2.Height)), (float)0f); text1.Width = single1; text1.WrappingWidth = single1; text1.UpdateSize(); float single3 = System.Math.Min(text1.Height, single2); float single4 = obj1.Left + ef1.Width; float single5 = (obj1.Top + ef1.Height) + ((single2 - single3) / 2f); text1.Bounds = new RectangleF(single4, single5, single1, single3); } } if ((obj1 == null) && this.AutoResizes) { obj1 = text1; } if (obj1 != null) { if (this.TopPort != null) { this.TopPort.SetSpotLocation(0x20, obj1, 0x20); } if (this.RightPort != null) { this.RightPort.SetSpotLocation(0x40, obj1, 0x40); } if (this.BottomPort != null) { this.BottomPort.SetSpotLocation(0x80, obj1, 0x80); } if (this.LeftPort != null) { this.LeftPort.SetSpotLocation(0x100, obj1, 0x100); } } } } }
public override void LayoutChildren(DiagramShape childchanged) { if (!base.Initializing) { DiagramText text1 = this.Label; if (text1 != null) { DiagramShape obj1 = this.Background; if (obj1 != null) { SizeF ef1 = this.TopLeftMargin; SizeF ef2 = this.BottomRightMargin; obj1.Bounds = new RectangleF(text1.Left - ef1.Width, text1.Top - ef1.Height, (text1.Width + ef1.Width) + ef2.Width, (text1.Height + ef1.Height) + ef2.Height); } } } }
public override void Remove(DiagramShape obj) { base.Remove(obj); if (obj == this.myLabel) { this.myLabel = null; } else if (obj == this.myBack) { this.myBack = null; } }
internal static DiagramText FindLabel(DiagramShape obj) { DiagramText text1 = obj as DiagramText; if (text1 != null) { return text1; } GroupShape group1 = obj as GroupShape; if (group1 != null) { GroupEnumerator enumerator2 = group1.GetEnumerator(); GroupEnumerator enumerator1 = enumerator2.GetEnumerator(); while (enumerator1.MoveNext()) { DiagramText text2 = DiagramNode.FindLabel(enumerator1.Current); if (text2 != null) { return text2; } } } return null; }
public override void Remove(DiagramShape obj) { base.Remove(obj); if (obj == this.myBack) { this.myBack = null; } else if (obj == this.myLabel) { this.myLabel = null; } else if (obj == this.myTopPort) { this.myTopPort = null; } else if (obj == this.myRightPort) { this.myRightPort = null; } else if (obj == this.myBottomPort) { this.myBottomPort = null; } else if (obj == this.myLeftPort) { this.myLeftPort = null; } }
protected override void OnLayerChanged(DiagramLayer oldLayer, DiagramLayer newLayer, DiagramShape mainObj) { base.OnLayerChanged(oldLayer, newLayer, mainObj); if (((oldLayer != null) && (newLayer == null)) && oldLayer.IsInDocument) { DiagramDocument document1 = oldLayer.Document; IDictionaryEnumerator enumerator1 = this.Map.GetEnumerator(); while (enumerator1.MoveNext()) { DictionaryEntry entry1 = enumerator1.Entry; DiagramView view1 = (DiagramView)entry1.Key; Control control1 = (Control)entry1.Value; if ((view1 != null) && (control1 != null)) { this.DisposeControl(control1, view1); } } this.Map.Clear(); } else if (((oldLayer != null) && (newLayer == null)) && oldLayer.IsInView) { DiagramView view2 = oldLayer.View; Control control2 = this.FindControl(view2); if (control2 != null) { this.Map.Remove(view2); if (control2 != null) { this.DisposeControl(control2, view2); } } } }