public object ESRI_FeatureService_remove(ResultBuffer rb)
        {
            object result;

            try
            {
                string            argument = LspUtil.GetArgument(rb, 0, null);
                MSCFeatureService mSCFeatureService;
                if (!string.IsNullOrEmpty(argument))
                {
                    mSCFeatureService = this.GetFeatureService(argument);
                }
                else
                {
                    mSCFeatureService = this.GetCurrentFeatureService();
                }
                if (mSCFeatureService == null)
                {
                    result = null;
                }
                else
                {
                    bool queryOnly = mSCFeatureService.QueryOnly;
                    if (mSCFeatureService.DeleteService())
                    {
                        AfaDocData.ActiveDocData.DocDataset.FeatureServices.Remove(argument);
                        MSCDataset.SetDefaultActiveFeatureClass();
                        if (AfaDocData.ActiveDocData.DocDataset.FeatureServices.Count == 0)
                        {
                            ArcGISRibbon.EnableFeatureServiceButtons(false);
                        }
                        if (!queryOnly)
                        {
                            ToolPalette.UpdatePalette(AfaDocData.ActiveDocData.DocDataset.ParentDocument, AfaDocData.ActiveDocData.DocDataset, false);
                        }
                    }
                    result = true;
                }
            }
            catch
            {
                result = null;
            }
            return(result);
        }
예제 #2
0
 private static void DocumentActivated(object sender, DocumentCollectionEventArgs e)
 {
     try
     {
         if (DocumentDataObject.ActiveDocData != null)
         {
             MSCFeatureClass topActiveFeatureClass = AfaDocData.ActiveDocData.GetTopActiveFeatureClass();
             if (topActiveFeatureClass != null)
             {
                 ArcGISRibbon.SetActiveFeatureClass(topActiveFeatureClass);
             }
             MSCFeatureClass activeSubtype = AfaDocData.ActiveDocData.GetActiveSubtype();
             if (activeSubtype != null)
             {
                 ArcGISRibbon.SetActiveFeatureClass(activeSubtype);
             }
             if (AfaDocData.ActiveDocData.DocDataset.FeatureServices != null)
             {
                 AfaDocData.ActiveDocData.DocDataset.ShowFeatureServiceLayers(true);
                 if (AfaDocData.ActiveDocData.DocDataset.FeatureServices.Count > 0)
                 {
                     ArcGISRibbon.EnableFeatureServiceButtons(true);
                 }
                 else
                 {
                     ArcGISRibbon.EnableFeatureServiceButtons(false);
                 }
             }
             if (AfaDocData.ActiveDocData.CurrentMapService != null)
             {
                 ArcGISRibbon.SetActiveRasterService(AfaDocData.ActiveDocData.CurrentMapService);
             }
             else if (AfaDocData.ActiveDocData.CurrentImageService != null)
             {
                 ArcGISRibbon.SetActiveRasterService(AfaDocData.ActiveDocData.CurrentImageService);
             }
             ToolPalette.UpdatePalette(AfaDocData.ActiveDocData.Document, AfaDocData.ActiveDocData.DocDataset);
         }
     }
     catch
     {
     }
 }
        protected override void Attach(Document doc)
        {
            this.NOD = doc.Database.NamedObjectsDictionaryId;
            Database arg_17_0 = doc.Database;

            try
            {
                using (Transaction transaction = doc.TransactionManager.StartTransaction())
                {
                    this.DocPRJ = new MSCPrj();
                    this.DocPRJ.Initialize(this.NOD, transaction);
                    this.DocDataset = new MSCDataset();
                    this.DocDataset.Initialize(doc, transaction);
                    if (this.DocDataset.FeatureClasses.Count > 0)
                    {
                        this.CurrentFC = this.DocDataset.FeatureClasses.ElementAt(0).Value;
                        ArcGISRibbon.EnableFeatureServiceButtons(false);
                    }
                    else if (this.DocDataset.FeatureServices.Count > 0)
                    {
                        this.CurrentFC = this.DocDataset.FeatureServices.ElementAt(0).Value;
                        ArcGISRibbon.EnableFeatureServiceButtons(true);
                    }
                    transaction.Commit();
                    if (this.DocDataset.HasFeatureServicesOpenedForEditing())
                    {
                        ToolPalette.ShowPalette(doc, this.DocDataset);
                    }
                    else
                    {
                        ToolPalette.UpdatePalette(doc, this.DocDataset, false);
                    }
                }
            }
            catch
            {
            }
        }
예제 #4
0
 public void SetButton( ToolPalette.ToolButton tb )
 {
     butt = tb;
 }