Ejemplo n.º 1
0
        public bool Paste(IEnumName ienumName_0, ref bool bool_0)
        {
            ienumName_0.Reset();
            IName name = ienumName_0.Next();

            while (name != null)
            {
                if ((name is IFileName) && Directory.Exists((name as IFileName).Path))
                {
                    IGxObject obj2 = new GxDiskConnection();
                    (obj2 as IGxFile).Path = (name as IFileName).Path;
                    obj2.Attach(this, this);
                    this.ObjectAdded(obj2);
                }
            }
            return(false);
        }
Ejemplo n.º 2
0
        public IGxFolder ConnectFolder(string string_0)
        {
            IGxObject obj2;
            string    str = string_0.ToUpper();

            for (int i = 0; i < this.igxObjectArray_0.Count; i++)
            {
                obj2 = this.igxObjectArray_0.Item(i);
                if ((obj2 is IGxDiskConnection) && (obj2.Name.ToUpper() == str))
                {
                    return(obj2 as IGxFolder);
                }
            }
            obj2 = new GxDiskConnection();
            (obj2 as IGxFile).Path = string_0;
            obj2.Attach(this, this);
            this.ObjectAdded(obj2);
            XmlDocument document = new XmlDocument();
            string      path     = Application.StartupPath + @"\CatalogConfig.xml";

            if (File.Exists(path))
            {
                document.Load(path);
            }
            else
            {
                StringBuilder builder = new StringBuilder();
                builder.Append("<?xml version='1.0' encoding='utf-8' ?>");
                builder.Append("<Links>");
                builder.Append("</Links>");
                document.LoadXml(builder.ToString());
            }
            XmlElement documentElement = document.DocumentElement;
            XmlNode    newChild        = document.CreateNode(XmlNodeType.Element, "Link", "");

            documentElement.AppendChild(newChild);
            XmlAttribute node = document.CreateAttribute("Folder");

            node.Value = string_0;
            newChild.Attributes.Append(node);
            document.Save(path);
            return(obj2 as IGxFolder);
        }
Ejemplo n.º 3
0
 public void Open()
 {
     if (CatalogLicenseProviderCheck.Check())
     {
         IGxObject obj2;
         string[]  logicalDrives = Directory.GetLogicalDrives();
         int       index         = 0;
         while (true)
         {
             if (index >= logicalDrives.Length)
             {
                 break;
             }
             try
             {
                 if ((logicalDrives[index].ToUpper() != @"A:\") && (logicalDrives[index].ToUpper() != @"B:\"))
                 {
                     obj2 = new GxDiskConnection();
                     (obj2 as IGxFile).Path = logicalDrives[index];
                     obj2.Attach(this, this);
                 }
             }
             catch
             {
             }
             index++;
         }
         string path = Application.StartupPath + @"\CatalogConfig.xml";
         if (File.Exists(path))
         {
             this.method_0(path);
         }
         obj2 = new GxRemoteDatabaseFolder();
         obj2.Attach(this, this);
         obj2 = new GxDatabaseServerFolder();
         obj2.Attach(this, this);
         obj2 = new GxGISServersFolder();
         obj2.Attach(this, this);
     }
 }
Ejemplo n.º 4
0
 private void method_0(string string_0)
 {
     try
     {
         XmlDocument document = new XmlDocument();
         document.Load(string_0);
         XmlElement documentElement = document.DocumentElement;
         for (int i = 0; i < documentElement.ChildNodes.Count; i++)
         {
             XmlNode   node = documentElement.ChildNodes[i];
             string    str  = node.Attributes["Folder"].Value;
             IGxObject obj2 = new GxDiskConnection();
             (obj2 as IGxFile).Path = str;
             obj2.Attach(this, this);
         }
         document = null;
     }
     catch (Exception exception)
     {
         MessageBox.Show(exception.ToString());
     }
 }