예제 #1
0
        private void EventCommandStart(object sender, BeforeExecutedEventArgs e)
        {
            try
            {
                var uiapp     = (UIApplication)sender;
                var activeDoc = uiapp.ActiveUIDocument.Document;

                if (activeDoc.IsFamilyDocument)
                {
                    return;
                }
                _purgeSettings           = new EventSettings(activeDoc);
                _purgeSettings.SizeStart = _purgeSettings.GetFileSize();
                _purgeSettings.StartTime = DateTime.Now;
                _purgeStarted            = true;

                if (string.IsNullOrEmpty(_purgeSettings.DocCentralPath))
                {
                    return;
                }
                if (_purgeSettingsDictionary.ContainsKey(_purgeSettings.DocCentralPath))
                {
                    _purgeSettingsDictionary.Remove(_purgeSettings.DocCentralPath);
                }
                _purgeSettingsDictionary.Add(_purgeSettings.DocCentralPath, _purgeSettings);
            }
            catch (Exception ex)
            {
                Log.AppendLog(LogMessageType.EXCEPTION, ex.Message);
            }
        }
 /// <summary>
 /// The BeforeExecuted callback for the command, to setup the post action after the revision command is run.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 private void ReactToRevisionsAndSchedulesCommand(object sender, BeforeExecutedEventArgs args)
 {
     if (externalEvent != null)
     {
         externalEvent.Raise();
     }
 }
예제 #3
0
 private void ReactToRevisionsAndSchedulesCommand(object sender, BeforeExecutedEventArgs e)
 {
     if (externalEvent != null)
     {
         externalEvent.Raise();//实际执行了 CleanupAfterRevisionEdit 方法。
     }
 }
 void beforeExecuted(object sender, BeforeExecutedEventArgs e)
 {
     e.UsingCommandData = true;
 }
예제 #5
0
 public void AddInCommandBinding_BeforeExecuted(object sender, BeforeExecutedEventArgs e)
 {
     ExecuteEventHooks(EventType.AddInCommandBinding_BeforeExecuted, sender, e, e.CommandId.Name);
 }