Example #1
0
 public string CreateItem(string name, string guid, string parentguid, CiType citype)
 {
     if (citype == CiType.Project)
     {
         return this.CreateProject2(name);
     }
     else if (citype == CiType.Httpdd)
     {
         return this.Insert(name, guid, CiType.HttpddConf, Httpdd.GetDefaultHttpddHtml(name));
     }
     else if (citype == CiType.Pkg)
     {
         return this.Insert(name, guid, CiType.PkgHtml, Pkg.GetDefaultPkgHtml(name, name));
     }
     else if (citype == CiType.Layers)
     {
         Layer layer = new Layer() { name = name };
         return this.Insert(name, guid, CiType.LayerXML, Utility.XMLUtil.SerializeXML<Layer>(layer));
     }
     else if (citype == CiType.Symbols)
     {
         Symbol symbol = new Symbol() { name = name };
         return this.Insert(name, guid, CiType.SymbolXML, Utility.XMLUtil.SerializeXML<Symbol>(symbol));
     }
     else if (citype == CiType.Map)
     {
         Map map = new Map() { name = name };
         map.Web.Add(new Web() { maxScaleDenom=0,  minScaleDenom=0 });
         return this.Insert(name, guid, CiType.MapXML, Utility.XMLUtil.SerializeXML<Map>(map));
     }
     else
         return "";
 }
 public static bool LoadFromFile(string fileName, out Symbol obj)
 {
     System.Exception exception = null;
     return LoadFromFile(fileName, out obj, out exception);
 }
 /// <summary>
 /// Deserializes xml markup from file into an Symbol object
 /// </summary>
 /// <param Name="fileName">string xml file to load and deserialize</param>
 /// <param Name="obj">Output Symbol object</param>
 /// <param Name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
 public static bool LoadFromFile(string fileName, out Symbol obj, out System.Exception exception)
 {
     exception = null;
     obj = default(Symbol);
     try
     {
         obj = LoadFromFile(fileName);
         return true;
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return false;
     }
 }
 public static bool Deserialize(string xml, out Symbol obj)
 {
     System.Exception exception = null;
     return Deserialize(xml, out obj, out exception);
 }
 /// <summary>
 /// Deserializes workflow markup into an Symbol object
 /// </summary>
 /// <param Name="xml">string workflow markup to deserialize</param>
 /// <param Name="obj">Output Symbol object</param>
 /// <param Name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
 public static bool Deserialize(string xml, out Symbol obj, out System.Exception exception)
 {
     exception = null;
     obj = default(Symbol);
     try
     {
         obj = Deserialize(xml);
         return true;
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return false;
     }
 }