Example #1
0
        public void init(int programID, AxMapControl mc, Intersect.ProgramStepUserControl.OnFinish of, MainWindow mw)
        {
            inited = true;

            if (program == null)
                program = new Program();
            program.id = programID;
            program.select();

            if (project == null)
                project = new Project();
            project.id = program.projectID;
            project.select();

            NetSizeUserControl.init(program.id);
            ConditionUserControl.init(program.id);

            mapControl = mc;
            onFinish = of;
            mainWindow = mw;

            mapControlMouseDown = null;

            //在初始化时就要对valid进行判断.
            Thread t = new Thread(delegate()
            {
                System.Threading.Thread.Sleep(500);
                Dispatcher.BeginInvoke((ThreadStart)delegate()
                {
                    if (isValid())
                    {
                        valid = true;
                        onFinish(true);
                        IFeatureClass resultFeatureClass;
                        if ((resultFeatureClass = GisUtil.getFeatureClass(System.IO.Path.GetDirectoryName(project.path), "评价结果.shp")) != null)
                        {
                            IFeatureLayer resultFeatureLayer = new FeatureLayerClass();
                            resultFeatureLayer.FeatureClass = resultFeatureClass;
                            mapControl.AddLayer(resultFeatureLayer);
                        }
                        else
                        {
                            SiteSelector siteSelector = new SiteSelector(mapControl, program.id);
                            siteSelector.startSelectSite();
                        }
                    }
                });
            });
            t.Start();
        }
        public void init(int programID, AxMapControl mc, Intersect.ProgramStepUserControl.OnFinish of)
        {
            inited = true;

            if (program == null)
                program = new Program();
            program.id = programID;
            program.select();

            if (project == null)
                project = new Project();
            project.id = program.projectID;
            project.select();

            NetSizeUserControl.init(program.id);
            ConditionUserControl.init(program.id);

            mapControl = mc;
            onFinish = of;

            mapControlMouseDown = null;

            //在初始化时就要对valid进行判断.
            Thread t = new Thread(delegate()
            {
                System.Threading.Thread.Sleep(500);
                Dispatcher.BeginInvoke((ThreadStart)delegate()
                {
                    if (isValid())
                    {
                        valid = true;
                        onFinish(true);
                        SiteSelector siteSelector = new SiteSelector(mapControl, program.id);
                        siteSelector.startSelectSite();
                    }
                });
            });
            t.Start();
        }
 private void StartCaculateButtonClick(object sender, RoutedEventArgs e)
 {
     if (isValid())
     {
         if (isDirty())
         {
             if (Ut.C("已对设置做出修改, 继续执行将删除之前的数据, 是否继续?"))
             {
                 dirty = true;
             }
             else
             {
                 return;
             }
         }
         valid = true;
         onFinish(true);
         save();
         //开始计算.
         SiteSelector siteSelector = new SiteSelector(mapControl, program.id);
         siteSelector.startSelectSite();
     }
     else
     {
         Ut.M("请完整填写信息.");
         return;
     }
 }