Пример #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 "";
 }
Пример #2
0
        public void testLayer()
        {
            Map map = new Map();
            Layer layer = new Layer();

            Class c = new Class();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string file = "c:\\x\\x\\aa.txt\\a";
            Directory.CreateDirectory(file);
            FileInfo fi = new FileInfo(file);

            fi.Create();

            String filepath = Server.MapPath("/xmlmapfile/tests") + "";
            string layersetpath = filepath + "\\layerset.xml";
            string mapfilepath = filepath + "\\mapfile-test.xml";
            string symbolsetpath = filepath + "\\symbolset.xml";

            Map map = new Map();
            Map map1 = Utility.XMLUtil.DeserializeXML2<Map>(mapfilepath) as Map;

            LayerSet LayerSet1 = Utility.XMLUtil.DeserializeXML2<LayerSet>(layersetpath) as LayerSet;
            SymbolSet SymbolSet1 = Utility.XMLUtil.DeserializeXML2<SymbolSet>(symbolsetpath) as SymbolSet;
        }
 public static bool LoadFromFile(string fileName, out Map obj)
 {
     System.Exception exception = null;
     return LoadFromFile(fileName, out obj, out exception);
 }
 /// <summary>
 /// Deserializes xml markup from file into an Map object
 /// </summary>
 /// <param Name="fileName">string xml file to load and deserialize</param>
 /// <param Name="obj">Output Map 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 Map obj, out System.Exception exception)
 {
     exception = null;
     obj = default(Map);
     try
     {
         obj = LoadFromFile(fileName);
         return true;
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return false;
     }
 }
 public static bool Deserialize(string xml, out Map obj)
 {
     System.Exception exception = null;
     return Deserialize(xml, out obj, out exception);
 }
 /// <summary>
 /// Deserializes workflow markup into an Map object
 /// </summary>
 /// <param Name="xml">string workflow markup to deserialize</param>
 /// <param Name="obj">Output Map 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 Map obj, out System.Exception exception)
 {
     exception = null;
     obj = default(Map);
     try
     {
         obj = Deserialize(xml);
         return true;
     }
     catch (System.Exception ex)
     {
         exception = ex;
         return false;
     }
 }
Пример #8
0
 public void SaveApp(string name, Map map)
 {
     string filepath = Path.Combine(this.MsRoot, "ms4w/apps", this.AppRootFolder, name);
     Utility.FileUtil.Save2Disk<Map>(map, filepath);
 }