Ejemplo n.º 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);
     }
 }
Ejemplo n.º 2
0
        //public String StatusMessage
        //{
        //    get { return myMessage; }
        //    set
        //    {
        //        myMessage = value;
        //        SetStatusMessage?.Invoke(myMessage);
        //    }
        //}

        /// <summary>
        /// This method is responsible for updating all of the view's visible
        /// state outside of the GoView itself--the title bar, status bar, and properties grid.
        /// </summary>
        public void UpdateFormInfo()
        {
            UpdateTitle();
            SetStatusMessage?.Invoke(Doc.Location);
            SetStatusZoom?.Invoke(DocScale);
        }