Пример #1
0
        public void OnEvent(object MapEvent)
        {
            if (_module != null && _module.SelectedNetworkTracer != null)
            {
                if (_module.SelectedNetworkTracer is INetworkTracerProperties &&
                    ((INetworkTracerProperties)_module.SelectedNetworkTracer).NetworkTracerProperties(_module.SelectedNetworkFeatureClass, TracerInput()) != null)
                {
                    FormTracerProperties dlg = new FormTracerProperties(
                        ((INetworkTracerProperties)_module.SelectedNetworkTracer).NetworkTracerProperties(_module.SelectedNetworkFeatureClass, TracerInput()));
                    if (dlg.ShowDialog() != System.Windows.Forms.DialogResult.OK)
                    {
                        return;
                    }
                }
                if (_module.SelectedNetworkTracer is IProgressReporterEvent)
                {
                    NetworkProgressReporter reporter = new NetworkProgressReporter(_doc);

                    Thread       thread = new Thread(new ParameterizedThreadStart(this.Trace));
                    FormProgress dlg    = new FormProgress();
                    dlg.ShowProgressDialog(reporter, reporter, thread);
                }
                else
                {
                    Trace(null);
                }
                ((MapEvent)MapEvent).drawPhase  = DrawPhase.Graphics;
                ((MapEvent)MapEvent).refreshMap = true;
            }
        }
Пример #2
0
        public IExplorerObject CreateExplorerObject(IExplorerObject parentExObject)
        {
            if (!(parentExObject is SQLiteFDBDatasetExplorerObject))
            {
                return(null);
            }

            SQLiteFDBDatasetExplorerObject parent = (SQLiteFDBDatasetExplorerObject)parentExObject;

            IFeatureDataset dataset = ((SQLiteFDBDatasetExplorerObject)parentExObject).Object as IFeatureDataset;

            if (dataset == null || !(dataset.Database is SQLiteFDB))
            {
                return(null);
            }

            FormNewNetworkclass dlg = new FormNewNetworkclass(dataset, typeof(CreateFDBNetworkFeatureclass));

            if (dlg.ShowDialog() != DialogResult.OK)
            {
                return(null);
            }

            CreateFDBNetworkFeatureclass creator = new CreateFDBNetworkFeatureclass(
                dataset, dlg.NetworkName,
                dlg.EdgeFeatureclasses,
                dlg.NodeFeatureclasses);

            creator.SnapTolerance               = dlg.SnapTolerance;
            creator.ComplexEdgeFcIds            = dlg.ComplexEdgeFcIds;
            creator.GraphWeights                = dlg.GraphWeights;
            creator.SwitchNodeFcIdAndFieldnames = dlg.SwitchNodeFcIds;
            creator.NodeTypeFcIds               = dlg.NetworkNodeTypeFcIds;

            FormProgress progress = new FormProgress();

            progress.ShowProgressDialog(creator, null, creator.Thread);

            IDatasetElement element = ((IFeatureDataset)parentExObject.Object)[dlg.NetworkName];

            return(new SQLiteFDBFeatureClassExplorerObject(
                       parent,
                       parent.FileName,
                       parent.Name,
                       element));
        }