示例#1
0
 /// <summary>
 /// Recursively Publish metadata documents associated to a container
 /// </summary>
 /// <param name="item">The GxObject object</param>
 /// <param name="pr">The publication request object</param>
 private void publishMetadata(IGxObject item, PublicationRequest pr)
 {
     if (item is IGxObjectContainer && !item.Category.Trim().ToLower().StartsWith("arcgis server"))
     {
         IGxObjectContainer container = (IGxObjectContainer)item;
         IEnumGxObject      children  = container.Children;
         if (children == null)
         {
             writeResults(pr.publish(item));
             return;
         }
         IGxObject child = children.Next();
         while (child != null)
         {
             publishMetadata(child, pr);
             child = children.Next();
         }
     }
     else
     {
         if (item is IMetadata)
         {
             writeResults(pr.publish(item));
         }
         else
         {
             writeResults(pr.publish(item, pr.makeAgsUrl(item)));
         }
     }
 }
示例#2
0
        public void Delete()
        {
            File.Delete(m_names[0]);

            //Tell parent the object is gone
            IGxObjectContainer pGxObjectContainer = (IGxObjectContainer)m_gxParent;

            pGxObjectContainer.DeleteChild(this);
        }
示例#3
0
        public void DoFilter()
        {
            try
            {
                IFilterValue filter = pGxObjectFilter as IFilterValue;
                filter.Filter = "";

                filteredObjects.Clear();

                Debug.WriteLine(string.Format("DoFilter: {0}", this.Value));
                string filterString = this.Value;
                Debug.WriteLine(filterString);

                IGxObject     pGxObj;
                IEnumGxObject pEnumGxObject;


                IGxSelection pGxSelection = _pGxApp.Selection;

                if (pGxSelection == null)
                {
                    return;
                }

                IEnumGxObject pSelectedGxObjects = pGxSelection.SelectedObjects;

                IGxObject pGxObject_Current = pGxSelection.Location;


                IGxObjectContainer pGxObjectContainer = null;
                if (pGxObject_Current is IGxObjectContainer)
                {
                    pGxObjectContainer = pGxObject_Current as IGxObjectContainer;
                }


                if (!pGxObjectContainer.HasChildren)
                {
                    return;
                }

                pEnumGxObject = pGxObjectContainer.Children;

                if (pEnumGxObject == null)
                {
                    return;
                }

                filter        = pGxObjectFilter as IFilterValue;
                filter.Filter = filterString;

                pGxObj = pEnumGxObject.Next();
                while (pGxObj != null)
                {
                    bool canDisplay = pGxObjectFilter.CanDisplayObject(pGxObj);
                    if (canDisplay == false)
                    {
                        //* if the object is not going to be displayed (due to being filtered out) we will track it so we can unselect it later (if it was selected)
                        filteredObjects.Add(pGxObj);
                    }

                    pGxObj = pEnumGxObject.Next();
                }

                //* Since selected objects stay selected after filtering, we need to manually unselect hidden items due to the filter
                IGxObject pGxObjSelected = pSelectedGxObjects.Next();
                while (pGxObjSelected != null)
                {
                    if (filteredObjects.Contains(pGxObjSelected))
                    {
                        Debug.WriteLine("Selected Object that is hidden: " + pGxObjSelected.FullName);
                        pGxSelection.Unselect(pGxObjSelected, null);
                    }

                    pGxObjSelected = pSelectedGxObjects.Next();
                }

                pGxContentsView.ObjectFilter = pGxObjectFilter;
            }
            catch (Exception ex)
            {
                ArcCatalog.Application.StatusBar.set_Message(0, ex.Message);
            }
            finally
            {
                _pGxView.Refresh();
            }

            //UpdateItems(filterString);
        }