示例#1
0
        public static MemoryDataSource FromXElement(XElement ele)
        {
            if (ele == null)
            {
                return(null);
            }
            string name = null;

            if (ele.Attribute("name") != null)
            {
                name = ele.Attribute("name").Value;
            }
            string        shapetype = ele.Attribute("shapetype").Value;
            enumShapeType stype     = enumShapeType.Point;

            foreach (enumShapeType st in Enum.GetValues(typeof(enumShapeType)))
            {
                if (st.ToString() == shapetype)
                {
                    stype = st;
                    break;
                }
            }
            MemoryDataSource ds = new MemoryDataSource(name, stype);

            if (ele.Element("ArgsOfLeveling") != null)
            {
                ds.SetArgOfLevel(ArgOfLeveling.FromXElement(ele.Element("ArgsOfLeveling")));
            }
            return(ds);
        }
示例#2
0
        public static FileDataSource FromXElement(XElement ele)
        {
            if (ele == null)
            {
                return(null);
            }
            string name = null;

            if (ele.Attribute("name") != null)
            {
                name = ele.Attribute("name").Value;
            }
            string fileurl = ele.Attribute("fileurl").Value;
            string fname   = MapFactory.GetFullFilename(fileurl);

            if (!File.Exists(fname))
            {
                return(null);
            }
            FileDataSource ds = new FileDataSource(name, fname);

            if (ele.Element("ArgsOfLeveling") != null)
            {
                ds.SetArgOfLevel(ArgOfLeveling.FromXElement(ele.Element("ArgsOfLeveling")));
            }
            return(ds);
        }
 public VectorFeatureSpatialDbReader(IDbConnection dbConnection, string fetclassName, bool allowReadAllAtFirst, ArgOfLeveling arg)
     : this(dbConnection, fetclassName)
 {
     _allowReadAllAtFirst = allowReadAllAtFirst;
     _argOfLeveling       = arg;
     if (allowReadAllAtFirst)
     {
         ReadAllReaturesIntoMemory();
     }
 }
示例#4
0
        public static ArgOfLeveling FromXElement(XElement ele)
        {
            if (ele == null)
            {
                return(new ArgOfLeveling(false));
            }
            ArgOfLeveling arg = new ArgOfLeveling();

            arg.Enabled    = bool.Parse(ele.Attribute("enabled").Value);
            arg.GridSize   = int.Parse(ele.Attribute("gridsize").Value);
            arg.BeginLevel = int.Parse(ele.Attribute("beginlevel").Value);
            return(arg);
        }
示例#5
0
        public static IServerDataSource FromXElement(XElement xele)
        {
            if (xele == null)
            {
                return(null);
            }
            string           name       = xele.Attribute("name").Value;
            string           uri        = xele.Attribute("uri").Value;
            InstanceIdentify instanceId = InstanceIdentify.FromXElement(xele.Element("InstanceIdentify"));
            FetClassIdentify fetclassId = FetClassIdentify.FromXElement(xele.Element("FetClassIdentify"));
            ServerDataSource ds         = new ServerDataSource(name, uri, instanceId, fetclassId);

            if (xele.Element("ArgsOfLeveling") != null)
            {
                ds.SetArgOfLevel(ArgOfLeveling.FromXElement(xele.Element("ArgsOfLeveling")));
            }
            return(ds);
        }
示例#6
0
        public static SpatialDbDataSource FromXElement(XElement ele)
        {
            if (ele == null)
            {
                return(null);
            }
            string name = null;

            if (ele.Attribute("name") != null)
            {
                name = ele.Attribute("name").Value;
            }
            SpatialDbDataSource ds = new SpatialDbDataSource(name, ele.Attribute("connectionstring").Value);

            if (ele.Element("ArgsOfLeveling") != null)
            {
                ds.SetArgOfLevel(ArgOfLeveling.FromXElement(ele.Element("ArgsOfLeveling")));
            }
            return(ds);
        }
示例#7
0
 public static IVectorFeatureSpatialDbReader GetVectorFeatureSpatialDbReader(IDbConnection dbConn, string fetclass, bool allowReadAllAtFirst, ArgOfLeveling argOfLeveling)
 {
     return(new VectorFeatureSpatialDbReader(dbConn, fetclass, allowReadAllAtFirst, argOfLeveling));
 }
 public void SetArgsOfLeveling(ArgOfLeveling arg)
 {
     _arg = arg;
 }
 internal void SetArgOfLevel(ArgOfLeveling arg)
 {
     _argOfLeveling = arg;
 }
示例#10
0
 public FeatureDataSourceBase(string name)
 {
     _name                  = name;
     _argOfLeveling         = new ArgOfLeveling();
     _argOfLeveling.Enabled = false;
 }