Beispiel #1
0
 public static void Initialize(Type type)
 {
     try
     {
         if (!(DocumentDataObject.instanceType != null))
         {
             if (type == null)
             {
                 throw new InvalidOperationException("null instance type");
             }
             DocumentDataObject.instanceType = type;
             foreach (Document doc in Application.DocumentManager)
             {
                 DocumentDataObject.AddDocument(doc);
             }
             if (!DocumentDataObject.ReactorsStarted)
             {
                 Application.DocumentManager.DocumentCreated       += (new DocumentCollectionEventHandler(DocumentDataObject.DocumentCreated));
                 Application.DocumentManager.DocumentBecameCurrent += (new DocumentCollectionEventHandler(DocumentDataObject.DocumentBecameCurrent));
                 Application.DocumentManager.DocumentActivated     += (new DocumentCollectionEventHandler(DocumentDataObject.DocumentActivated));
                 Application.DocumentManager.DocumentToBeDestroyed += (new DocumentCollectionEventHandler(DocumentDataObject.DocumentToBeDestroyed));
                 DocumentDataObject.ReactorsStarted = true;
             }
         }
     }
     catch
     {
     }
 }
Beispiel #2
0
 private static void DocumentCreated(object sender, DocumentCollectionEventArgs e)
 {
     if (e.Document != null)
     {
         DocumentDataObject.AddDocument(e.Document);
     }
 }
Beispiel #3
0
 public void Initialize()
 {
     DocumentDataObject.Initialize(typeof(AfaDocData));
     SplashScreenForm.DisplaySplashScreenFor(3);
     AfaDocData.ActiveDocData.DocDataset.ShowFeatureServiceLayers(true);
     ArcGISRibbon.Initialize();
 }
Beispiel #4
0
 private static DocumentDataObject Create(Document doc)
 {
     if (DocumentDataObject.instanceType != null)
     {
         DocumentDataObject documentDataObject = (DocumentDataObject)Activator.CreateInstance(DocumentDataObject.instanceType, true);
         documentDataObject.m_ThisDoc = doc;
         documentDataObject.Attach(doc);
         return(documentDataObject);
     }
     throw new InvalidOperationException(AfaStrings.NoInstanceClassSpecified);
 }
Beispiel #5
0
 public void Terminate()
 {
     try
     {
         this.CleanOutTempFiles();
         DocumentDataObject.Terminate();
         ArcGISRibbon.Terminate();
         GC.Collect();
         GC.WaitForPendingFinalizers();
     }
     catch
     {
     }
 }
Beispiel #6
0
 private static void AddDocument(Document doc)
 {
     if (doc == null)
     {
         return;
     }
     if (!DocumentDataObject.m_docMap.ContainsKey(doc))
     {
         Database database = doc.TryGetDatabase();
         if (database != null)
         {
             DocumentDataObject.m_docMap.Add(doc, DocumentDataObject.Create(doc));
         }
     }
 }
Beispiel #7
0
 private static void RemoveDocument(Document doc)
 {
     try
     {
         if (doc == null)
         {
             return;
         }
         DocumentDataObject documentDataObject = DocumentDataObject.DocData(doc);
         if (documentDataObject != null)
         {
             documentDataObject.Detach();
             documentDataObject.m_ThisDoc = null;
         }
     }
     catch
     {
     }
     DocumentDataObject.m_docMap.Remove(doc);
 }
 public static void Initialize()
 {
     DocumentDataObject.Initialize(typeof(AfaDocData));
 }
 public static AfaDocData DocData(Document doc)
 {
     return(DocumentDataObject.DocData(doc) as AfaDocData);
 }
Beispiel #10
0
 private static void DocumentToBeDestroyed(object sender, DocumentCollectionEventArgs e)
 {
     DocumentDataObject.RemoveDocument(e.Document);
 }