Пример #1
0
        public static bool CheckForArcPadTools(IGeoProcessor2 gp, bool finalCheck = false)
        {
            while (true)
            {
                string        tool;
                List <string> tools          = new List <string>();
                IGpEnumList   toolCollection = gp.ListToolboxes("arc*");

                while ((tool = toolCollection.Next()) != null)
                {
                    tools.Add(tool);
                }

                if (!tools.Contains("ArcPad Tools(ArcPad)"))
                {
                    if (!finalCheck)
                    {
                        gp.AddToolbox(ArcPadTbxPath);
                        finalCheck = true;
                        continue;
                    }
                    else
                    {
                        throw new Exception("Missing ArcPad Tools.");
                    }
                }
                break;
            }

            return(true);
        }
Пример #2
0
        /// <summary>Loads the custom OSM toolbox to the geoprocessor</summary>
        private void LoadCustomToolbox()
        {
            const string osmToolbox = @"ArcToolbox\Toolboxes\OpenStreetMap Toolbox.tbx";

            string toolboxPath = System.IO.Path.Combine(OSMGPFactory.GetArcGIS10InstallLocation(), osmToolbox);

            if (System.IO.File.Exists(toolboxPath))
            {
                IGpEnumList list = _gp.ListToolboxes("osmtools");
                if (string.IsNullOrEmpty(list.Next()))
                {
                    _gp.AddToolbox(toolboxPath);
                }
            }
        }