コード例 #1
0
ファイル: SiteSelector.cs プロジェクト: wingzhangmaybe/CGXM
        private void Init(AxMapControl mc, int programID)
        {
            gp = new Geoprocessor();
            mapControl = mc;
            UpdateMapLayerNameList(mapLayerNameList, mapControl);
            program = new Program();
            program.id = programID;
            program.select();
            project = new Project();
            project.id = program.projectID;
            project.select();
            netSize = program.getRelatedNetSize();
            conditionList = program.getAllRelatedCondition();
            baseFeature = GisUtil.GetBaseFeature(mapControl, project.baseMapIndex);
            mapFolder = System.IO.Path.GetDirectoryName(project.path);
            targetFolder = generateFolder(mapFolder);
            foreach (Condition condition in conditionList)
            {
                if (condition.type == C.CONFIG_TYPE_STANDARD)
                {
                    totalStandardValue += condition.value;
                }
            }
            fishnetPolygonName = "polygon.shp";
            fishnetName = "fishnet.shp";
            fishnetWidth = netSize.width;
            fishnetHeight = netSize.height;

            featureList = new List<Feature>();
        }
コード例 #2
0
 public bool isDirty()
 {
     int netSizeID = netSize.id;
     NetSize netSizeCopy = new NetSize();
     netSizeCopy.id = netSizeID;
     netSizeCopy.select();
     return !netSize.compare(netSizeCopy);
 }
コード例 #3
0
        public void init(int programID)
        {
            Program program = new Program();
            program.id = programID;
            netSize = program.getRelatedNetSize();
            if (netSize == null)
            {
                netSize = new NetSize();
                netSize.programID = programID;
                netSize.saveWithoutCheck();
                netSize.id = NetSize.GetLastNetSizeID();
            }

            Ut.bind(netSize, "width", BindingMode.TwoWay, NetSizeWidthTextBox, TextBox.TextProperty
                , new List<ValidationRule>() { new PositiveDoubleValidationRule() }, "NetSizeBindingGroup");
            Ut.bind(netSize, "height", BindingMode.TwoWay, NetSizeHeightTextBox, TextBox.TextProperty
                , new List<ValidationRule>() { new PositiveDoubleValidationRule() }, "NetSizeBindingGroup");
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: Leooonard/CGXM
 public NetSize getRelatedNetSize()
 {
     if (!isValid(new List<string>() { "prName", "pID" }))
         return null;
     string sqlCommand = String.Format(@"select nsID from NetSize where prID={0}", prID);
     Sql sql = new Sql();
     SqlDataReader reader = sql.selectNetSizeIDByPrID(sqlCommand);
     if (!reader.HasRows)
         return null;
     reader.Read();
     NetSize netSize = new NetSize();
     netSize.id = Int32.Parse(reader[0].ToString());
     netSize.select();
     return netSize;
 }
コード例 #5
0
ファイル: NetSize.cs プロジェクト: Leooonard/CGXM
 public bool compare(NetSize netSize)
 {
     if (id != netSize.id)
         return false;
     if (prID != netSize.programID)
         return false;
     if (nsWidth != netSize.width)
         return false;
     if (nsHeight != netSize.height)
         return false;
     return true;
 }