コード例 #1
0
        /// <summary>
        /// It may happen during synchronization that ElementID changes and it's week reference to the
        /// underlying model is broken so it is better to remove it from cache and recreate again when needed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        private void OnDocumentSynchronized(object sender, DocumentSynchronizedWithCentralEventArgs args)
        {
            var document = args.Document;

            if (Cache.Keys.Contains(document))
            {
                Cache.Remove(document);
            }
        }
コード例 #2
0
 void OnSynchronizedWithCentral(object sender, DocumentSynchronizedWithCentralEventArgs e)
 {
     try
     {
         Console.WriteLine("Synchronized with central");
     }
     catch (Exception err)
     {
         Console.Write(err.ToString());
     }
 }
コード例 #3
0
        /// <summary>
        /// Document Synchronized handler.
        /// </summary>
        private static void OnDocumentSynchronized(object source, DocumentSynchronizedWithCentralEventArgs args)
        {
            try
            {
                IsSynching = false; // enables DTM Tool again
                var doc = args.Document;
                if (doc == null)
                {
                    return;
                }

                var centralPath = FileInfoUtil.GetCentralFilePath(doc);
                if (string.IsNullOrEmpty(centralPath))
                {
                    return;
                }

                FailureProcessor.IsSynchronizing = false;

                // (Konrad) If project is not registered with MongoDB let's skip this
                if (MissionControlSetup.Projects.ContainsKey(centralPath) &&
                    MissionControlSetup.Configurations.ContainsKey(centralPath))
                {
                    var config = MissionControlSetup.Configurations[centralPath];
                    foreach (var updater in config.Updaters)
                    {
                        if (!updater.IsUpdaterOn)
                        {
                            continue;
                        }

                        if (string.Equals(updater.UpdaterId, Properties.Resources.HealthReportTrackerGuid, StringComparison.OrdinalIgnoreCase))
                        {
                            Tools.MissionControl.MissionControl.ProcessModels(ActionType.Synch, doc, centralPath);
                            Tools.MissionControl.MissionControl.ProcessWorksets(ActionType.Synch, doc, centralPath);
#if RELEASE2015 || RELEASE2016 || RELEASE2017
                            // (Konrad) We are not going to process warnings here.
#else
                            Tools.MissionControl.MissionControl.ProcessWarnings(ActionType.Synch, doc, centralPath);
#endif
                        }
                        else if (string.Equals(updater.UpdaterId, Properties.Resources.SheetsTrackerGuid, StringComparison.OrdinalIgnoreCase))
                        {
                            Tools.MissionControl.MissionControl.ProcessSheets(ActionType.Synch, doc, centralPath);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Log.AppendLog(LogMessageType.EXCEPTION, ex.Message);
            }
        }
コード例 #4
0
ファイル: Helpers.cs プロジェクト: kmorin/nwcautoviewexporter
        internal static void OnDocumentSynchronized(object sender, DocumentSynchronizedWithCentralEventArgs e)
        {
            Document doc = e.Document;

            if (Options.m_neo != null && Options.m_neo.ViewId.ToString() != "-1")
            {
                doc.Export(Options._folderExport, Options._NWCFileName, Options.m_neo);
            }
            else
            {
                TaskDialog.Show("Export Options", "You must set your export options before Automatic NWC file creation.");
            }
        }
コード例 #5
0
        private void EventSwcStop(object sender, DocumentSynchronizedWithCentralEventArgs e)
        {
            try
            {
                if (e.Document.IsFamilyDocument)
                {
                    return;
                }
                var docPath = GetCentralPath(e.Document);

                if (!_syncSettingsDictionary.ContainsKey(docPath))
                {
                    return;
                }
                var eventSettings = _syncSettingsDictionary[docPath];
                eventSettings.SizeEnd = eventSettings.GetFileSize();
                eventSettings.EndTime = DateTime.Now;
                WriteRecord(eventSettings, "SYNC-FILE");
            }
            catch (Exception ex)
            {
                Log.AppendLog(LogMessageType.EXCEPTION, ex.Message);
            }
        }
コード例 #6
0
 /// <summary>
 /// The OnDocumentSynchronized
 /// </summary>
 /// <param name="sender">The sender<see cref="object"/></param>
 /// <param name="args">The args<see cref="DocumentSynchronizedWithCentralEventArgs"/></param>
 private void OnDocumentSynchronized(object sender, DocumentSynchronizedWithCentralEventArgs args)
 {
 }
コード例 #7
0
ファイル: AppCommand.cs プロジェクト: dickiyamu/revit
 private static void OnDocumentSynchronizedWithCentral(object sender, DocumentSynchronizedWithCentralEventArgs e)
 {
     FailureProcessor.IsSynchronizing = false;
 }
コード例 #8
0
        public static void OnDocumentSyncEnd(object sender, DocumentSynchronizedWithCentralEventArgs args)
        {
            var syncDocument = args.Document;

            // do stuff with the info you have
        }
コード例 #9
0
 private void Revit_DocumentSynchronized(object sender, DocumentSynchronizedWithCentralEventArgs e)
 {
     SaveFileClients();
 }
コード例 #10
0
ファイル: Helpers.cs プロジェクト: kmorin/nwcautoviewexporter
 internal static void OnDocumentSynchronized(object sender, DocumentSynchronizedWithCentralEventArgs e)
 {
     Document doc = e.Document;
     if (Options.m_neo != null && Options.m_neo.ViewId.ToString() != "-1")
     {
       doc.Export(Options._folderExport, Options._NWCFileName, Options.m_neo);
     }
     else
     {
       TaskDialog.Show("Export Options", "You must set your export options before Automatic NWC file creation.");
     }
 }
コード例 #11
0
 /// <summary>
 /// It may happen during synchronization that ElementID changes and it's week reference to the
 /// underlying model is broken so it is better to remove it from cache and recreate again when needed
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="args"></param>
 private void OnDocumentSynchronized(object sender, DocumentSynchronizedWithCentralEventArgs args)
 {
     var document = args.Document;
     if (Cache.Keys.Contains(document))
         Cache.Remove(document);
 }
コード例 #12
0
 public void NotifyModelSynced(object sender, DocumentSynchronizedWithCentralEventArgs args)
 {
     // send notification to db
 }
コード例 #13
0
 public void RequestModelBackup(object sender, DocumentSynchronizedWithCentralEventArgs args)
 {
     BackupModelLocallyUsingRevit(args.Document);
 }
コード例 #14
0
 private void m_app_DocumentSavedToCentral(object sender, DocumentSynchronizedWithCentralEventArgs e)
 {
     DisplayEvent("Document saved to central");
 }
コード例 #15
0
        }//close Result

        private void DocSync(object sender, DocumentSynchronizedWithCentralEventArgs e)
        {
            string currentUser = _cachedUiApp.Application.Username;

            m_MyDock.txtBoxSyncTime.Text = String.Format("{0} {1}", Helpers.GetTime(), currentUser);
        }