/// <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); } }
void OnSynchronizedWithCentral(object sender, DocumentSynchronizedWithCentralEventArgs e) { try { Console.WriteLine("Synchronized with central"); } catch (Exception err) { Console.Write(err.ToString()); } }
/// <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); } }
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."); } }
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); } }
/// <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) { }
private static void OnDocumentSynchronizedWithCentral(object sender, DocumentSynchronizedWithCentralEventArgs e) { FailureProcessor.IsSynchronizing = false; }
public static void OnDocumentSyncEnd(object sender, DocumentSynchronizedWithCentralEventArgs args) { var syncDocument = args.Document; // do stuff with the info you have }
private void Revit_DocumentSynchronized(object sender, DocumentSynchronizedWithCentralEventArgs e) { SaveFileClients(); }
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."); } }
/// <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); }
public void NotifyModelSynced(object sender, DocumentSynchronizedWithCentralEventArgs args) { // send notification to db }
public void RequestModelBackup(object sender, DocumentSynchronizedWithCentralEventArgs args) { BackupModelLocallyUsingRevit(args.Document); }
private void m_app_DocumentSavedToCentral(object sender, DocumentSynchronizedWithCentralEventArgs e) { DisplayEvent("Document saved to central"); }
}//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); }