Beispiel #1
0
 /// <summary>
 /// If the document's name changes, update the title;
 /// if the document's location changes, update the status bar
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="evt"></param>
 protected override void OnDocumentChanged(Object sender, GoChangedEventArgs evt)
 {
     base.OnDocumentChanged(sender, evt);
     if (evt.Object is IGoLink &&
         (evt.SubHint == GoLink.ChangedFromPort || evt.SubHint == GoLink.ChangedToPort))
     {
         SetStatusMessage?.Invoke("Changed a link's port");
     }
     else if (evt.Hint == GoLayer.InsertedObject)
     {
         if (evt.Object is IGoLink)
         {
             SetStatusMessage?.Invoke("Inserted a link");
         }
     }
     else if (evt.Hint == GoLayer.RemovedObject)
     {
         if (evt.Object is IGoLink)
         {
             SetStatusMessage?.Invoke("Removed a link");
         }
     }
     else if (evt.Hint == GoDocument.ChangedName ||
              evt.Hint == GoDocument.RepaintAll || evt.Hint == GoDocument.FinishedUndo ||
              evt.Hint == GoDocument.FinishedRedo)
     {
         UpdateFormInfo();
     }
     else if (evt.Hint == GraphDoc.ChangedLocation)
     {
         SetStatusMessage?.Invoke(Doc.Location);
     }
 }
Beispiel #2
0
 public override void ChangeValue(GoChangedEventArgs e, bool undo)
 {
     if (e.SubHint == ChangedKind)
     {
         myKind = (BlockType)e.GetInt(undo);
     }
     else
     {
         base.ChangeValue(e, undo);
     }
 }
Beispiel #3
0
 // undo/redo support
 public override void ChangeValue(GoChangedEventArgs e, bool undo)
 {
     if (e.SubHint == ChangedStep)
     {
         this.Step = e.GetFloat(undo);
     }
     else
     {
         base.ChangeValue(e, undo);
     }
 }
Beispiel #4
0
 public override void ChangeValue(GoChangedEventArgs e, bool undo)
 {
     if (e.SubHint == ChangedKind)
     {
         ;
     }
     //myKind = (GraphNodeKind)e.GetInt(undo);
     else
     {
         base.ChangeValue(e, undo);
     }
 }
Beispiel #5
0
 /// <summary>
 /// If the document's name changes, update the title;
 /// if the document's location changes, update the status bar
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="evt"></param>
 protected override void OnDocumentChanged(Object sender, GoChangedEventArgs e)
 {
     base.OnDocumentChanged(sender, e);
     if (e.Hint == GoDocument.ChangedName || e.Hint == GoDocument.FinishedTransaction || e.Hint == GoDocument.AbortedTransaction ||
         e.Hint == GoDocument.RepaintAll || e.Hint == GoDocument.FinishedUndo || e.Hint == GoDocument.FinishedRedo)
     {
         UpdateFormInfo();
     }
     else if (e.Hint == FlowDocument.ChangedLocation)
     {
         MainBase.App.SetStatusMessage(this.Doc.Location);
     }
 }
Beispiel #6
0
        // handle undo and redo for the additional document state
        public override void ChangeValue(GoChangedEventArgs e, bool undo)
        {
            switch (e.Hint)
            {
            case ChangedPath:
                this.Path = (String)e.GetValue(undo);
                break;

            default:
                base.ChangeValue(e, undo);
                break;
            }
        }
Beispiel #7
0
        public override void ChangeValue(GoChangedEventArgs e, bool undo)
        {
            switch (e.Hint)
            {
            case ChangedLocation:
            {
                this.Location = (String)e.GetValue(undo);
                break;
            }

            default:
                base.ChangeValue(e, undo);
                return;
            }
        }
Beispiel #8
0
 // undo/redo support
 public override void ChangeValue(GoChangedEventArgs e, bool undo)
 {
     if (e.SubHint == ChangedBegin)
     {
         this.Begin = e.GetFloat(undo);
     }
     else if (e.SubHint == ChangedEnd)
     {
         this.End = e.GetFloat(undo);
     }
     else
     {
         base.ChangeValue(e, undo);
     }
 }
Beispiel #9
0
 /// <summary>
 /// If the document's name changes, update the title;
 /// if the document's location changes, update the status bar
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="evt"></param>
 protected override void OnDocumentChanged(Object sender, GoChangedEventArgs evt)
 {
     base.OnDocumentChanged(sender, evt);
     if (evt.Hint == GoDocument.ChangedName || evt.Hint == GoDocument.FinishedTransaction || evt.Hint == GoDocument.AbortedTransaction ||
         evt.Hint == GoDocument.RepaintAll || evt.Hint == GoDocument.FinishedUndo || evt.Hint == GoDocument.FinishedRedo)
     {
         UpdateFormInfo();
     }
     else if (evt.Hint == GraphDoc.ChangedLocation)
     {
         //MainForm.App.SetStatusMessage(this.Doc.Location);
     }
     else if (evt.Hint == GoDocument.FinishedTransaction)
     {
         //MainForm.App.EnableToolStripUndoButtons(this);
     }
 }
Beispiel #10
0
 private void GoViewDocument_Changed(object sender, GoChangedEventArgs e)
 {
     RefreshOverview();
 }
Beispiel #11
0
 // undo/redo support
 public override void ChangeValue(GoChangedEventArgs e, bool undo)
 {
     if (e.SubHint == ChangedStep)
         this.Step = e.GetFloat(undo);
     else
         base.ChangeValue(e, undo);
 }
Beispiel #12
0
 // undo/redo support
 public override void ChangeValue(GoChangedEventArgs e, bool undo)
 {
     if (e.SubHint == ChangedBegin)
         this.Begin = e.GetFloat(undo);
     else if (e.SubHint == ChangedEnd)
         this.End = e.GetFloat(undo);
     else
         base.ChangeValue(e, undo);
 }
Beispiel #13
0
 private void DocumentChanged(object sender, GoChangedEventArgs e)
 {
     // throw new NotImplementedException();
 }
Beispiel #14
0
 private void event2(object sender, GoChangedEventArgs e)
 {
 }
Beispiel #15
0
        protected void DocumentChanged(Object sender, GoChangedEventArgs evt)
        {
            switch (evt.Hint)
            {
            case GoLayer.InsertedObject:
            {
                // added a node to the document--gotta add it to the combobox's list of nodes
                IGoNode n = evt.Object as IGoNode;
                if (n != null && n.UserObject != null)
                {
                    this.NodeCombo.Items.Add(n.UserObject);        //((n.UserObject as ToolBase).ID);
                }
                break;
            }

            case GoLayer.RemovedObject:
            {
                // removed a node from the document--gotta remove from the combobox's list of nodes
                IGoNode n = evt.GoObject as IGoNode;
                if (n != null && this.Grid.SelectedObject == n.UserObject)
                {
                    this.Grid.SelectedObject = null;
                    int i = this.NodeCombo.Items.IndexOf(n.UserObject);
                    if (i >= 0)
                    {
                        this.NodeCombo.Items.RemoveAt(i);
                    }
                }
                break;
            }

            case GoLayer.ChangedObject:
            {
                switch (evt.SubHint)
                {
                case GoObject.ChangedBounds:
                {
                    // because we're displaying the GraphNode's size and position,
                    // we need to update the grid when the bounds change
                    IGoNode n = evt.GoObject as IGoNode;
                    if (n != null && n.UserObject != null &&
                        this.Grid.SelectedObject == n.UserObject)
                    {
                        RedisplayInfo();
                    }
                    break;
                }

                case GoText.ChangedText:
                {
                    // need to update combobox's list of node names
                    IGoNode n = evt.GoObject.ParentNode as IGoNode;
                    if (n != null && n.UserObject != null)
                    {
                        int i = this.NodeCombo.Items.IndexOf(n.UserObject);
                        if (i >= 0)
                        {
                            this.NodeCombo.Items[i] = n.UserObject;                  // reset to update displayed string
                        }
                        RedisplayInfo();
                    }
                    break;
                }
                }
                break;
            }

            case GoDocument.ChangedName:
            {
                // because we're displaying the document name in the grid,
                // we need to keep it up-to-date too
                RedisplayInfo();
                break;
            }
            }
        }
Beispiel #16
0
 public override void ChangeValue(GoChangedEventArgs e, bool undo)
 {
     switch (e.SubHint)
     {
         case ChangedOffset:
             this.Offset = e.GetSize(undo);
             return;
         case ChangedSegment:
             this.Segment = e.GetInt(undo);
             return;
         case ChangedSegmentPercentage:
             this.SegmentPercentage = e.GetFloat(undo);
             return;
         case ChangedConnectionColor:
             this.ConnectionColor = (Color)e.GetValue(undo);
             return;
         default:
             base.ChangeValue(e, undo);
             return;
     }
 }