示例#1
0
        /// <summary>
        /// Method that is called when Dynamo has finished loading and is ready to be used.
        /// </summary>
        /// <param name="rp">
        /// Parameters that provide references to Dynamo commands, settings and events.
        /// This object is supplied by Dynamo itself.
        /// </param>
        public void Ready(ReadyParams rp)
        {
            string message = "By pressing OK you agreeing to Tracker 🔍 data collection.";
            string title   = "Tracker 🔍 Terms of Usage Agreement";

            MessageBox.Show(message, title, MessageBoxButton.OK, MessageBoxImage.Exclamation);

            // we can register our own events that will be triggered when specific things happen in Dynamo
            // a reference to the ReadyParams is needed to do this, so we pass it on
            TrackerEvents.RegisterEventHandlers(rp);
        }
        /// <summary>
        /// Method that is called when Dynamo has finished loading and the UI is ready to be interacted with.
        /// </summary>
        /// <param name="vlp">
        /// Parameters that provide references to Dynamo commands, settings, events and
        /// Dynamo UI items like menus or the background preview. This object is supplied by Dynamo itself.
        /// </param>
        public void Loaded(ViewLoadedParams vlp)
        {
            // hold a reference to the Dynamo params to be used later
            _viewLoadedParams = vlp;

            // we can register our own events that will be triggered when specific things happen in Dynamo
            // a reference to the ReadyParams is needed to do this, so we pass it on
            TrackerEvents.RegisterRunEventHandlers((vlp.DynamoWindow.DataContext as DynamoViewModel).Model);

            // we can now add custom menu items to Dynamo's UI
            TrackerMenuItems();
        }
示例#3
0
 /// <summary>
 /// Method that is called when the host Dynamo application is closed.
 /// </summary>
 public void Shutdown()
 {
     TrackerEvents.UnregisterEventHandlers();
 }