/// <summary>
 /// 
 /// </summary>
 /// <param name="inFilter"></param>
 /// <param name="activeType"></param>
 /// <param name="isReadOnly"></param>
 public FilterCollection(IDrawingFilter inFilter, FilterTypes activeType, bool isReadOnly)
 {
     _filter = inFilter;
     _activeType = activeType;
     _isReadOnly = isReadOnly;
     Configure();
 }
Пример #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="featureSet"></param>
 /// <param name="inFilter"></param>
 /// <param name="activeType"></param>
 /// <param name="isReadOnly"></param>
 public FeatureSelection(IFeatureSet featureSet, IDrawingFilter inFilter, FilterType activeType, bool isReadOnly)
 {
     _filter = inFilter;
     _activeType = activeType;
     _isReadOnly = isReadOnly;
     _featureSet = featureSet;
     Configure();
 }
Пример #3
0
 /// <summary>
 /// Creates a new instance of FilterCollection, where the current state of the filter is
 /// recorded as the kind of "collection" that this item belongs to.  The filter can be
 /// altered later, and this will retain the original state.
 /// </summary>
 public FeatureSelection(IFeatureSet featureSet, IDrawingFilter inFilter, FilterType activeType)
 {
     _filter = inFilter;
     _activeType = activeType;
     _selectionState = true;
     _featureSet = featureSet;
     Configure();
 }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FeatureSelection"/> class.
 /// </summary>
 /// <param name="featureSet">The feature set.</param>
 /// <param name="inFilter">The drawing filter.</param>
 /// <param name="activeType">The filter type.</param>
 /// <param name="isReadOnly">Indicates whether the selection is read only.</param>
 public FeatureSelection(IFeatureSet featureSet, IDrawingFilter inFilter, FilterType activeType, bool isReadOnly)
 {
     Filter      = inFilter;
     ActiveType  = activeType;
     IsReadOnly  = isReadOnly;
     _featureSet = featureSet;
     Configure();
 }
Пример #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FeatureSelection"/> class.
 /// Creates a new instance of FilterCollection, where the current state of the filter is
 /// recorded as the kind of "collection" that this item belongs to. The filter can be
 /// altered later, and this will retain the original state.
 /// </summary>
 /// <param name="featureSet">The feature set.</param>
 /// <param name="inFilter">The drawing filter.</param>
 /// <param name="activeType">The filter type.</param>
 public FeatureSelection(IFeatureSet featureSet, IDrawingFilter inFilter, FilterType activeType)
 {
     Filter         = inFilter;
     ActiveType     = activeType;
     SelectionState = true;
     _featureSet    = featureSet;
     Configure();
 }
Пример #6
0
 /// <summary>
 /// Creates a new instance of Selection
 /// </summary>
 public Selection(IFeatureSet fs, IDrawingFilter inFilter):base(fs, inFilter, FilterTypes.Selection)
 {
     Selected = true;
     UseSelection = true;
     UseCategory = false;
     UseVisibility = false;
     UseChunks = false;
     SelectionMode = SelectionModes.IntersectsExtent;
 }
Пример #7
0
 /// <summary>
 /// Creates a new instance of Selection
 /// </summary>
 public Selection(IFeatureSet fs, IDrawingFilter inFilter)
     : base(fs, inFilter, FilterType.Selection)
 {
     Selected      = true;
     UseSelection  = true;
     UseCategory   = false;
     UseVisibility = false;
     UseChunks     = false;
     SelectionMode = SelectionMode.IntersectsExtent;
 }
Пример #8
0
        /// <summary>
        /// The configure.
        /// </summary>
        /// <param name="featureSet">
        /// The feature set.
        /// </param>
        private void Configure(IFeatureSet featureSet)
        {
            _categoryExtents = new Dictionary<IFeatureCategory, Extent>();
            _drawingBounds = new Rectangle(-32000, -32000, 64000, 64000);
            DataSet = featureSet;
            LegendText = featureSet.Name;
            _name = featureSet.Name;
            var label = new SymbologyMenuItem(Msg.FeatureLayer_Labeling);
            label.MenuItems.Add(new SymbologyMenuItem(Msg.FeatureLayer_Label_Setup, SymbologyImages.Label, LabelSetupClick));
            label.MenuItems.Add(new SymbologyMenuItem(Msg.SetDynamicVisibilityScale, SymbologyImages.ZoomScale,
                                                      LabelExtentsClick));
            ContextMenuItems.Insert(4, label);
            var selection = new SymbologyMenuItem(Msg.FeatureLayer_Selection, SymbologyImages.select, null);
            ContextMenuItems.Insert(5, selection);
            selection.MenuItems.Add(new SymbologyMenuItem(Msg.FeatureLayer_Zoom_To_Selected, SymbologyImages.ZoomInMap,
                                                          SelectionZoomClick));
            selection.MenuItems.Add(new SymbologyMenuItem(Msg.FeatureLayer_Create_Layer_From_Selected_Features, SymbologyImages.Copy,
                                                          SelectionToLayerClick));
            selection.MenuItems.Add(new SymbologyMenuItem(Msg.FeatureLayer_SelectAll, SymbologyImages.select_all, SelectAllClick));
            selection.MenuItems.Add(new SymbologyMenuItem(Msg.FeatureLayer_UnselectAll, SymbologyImages.deselect_16x16, UnselectAllClick));

            ContextMenuItems.Add(new SymbologyMenuItem(Msg.FeatureLayer_Join_Excel_File, SymbologyImages.redbluearrows,
                                                       JoinExcel));
            if (!featureSet.IndexMode)
            {
                _editMode = true;
            }

            // Categories and selections

            // these are like a stored procedure that only care about the selection and no other drawing characteristics.
            if (_editMode)
            {
                _drawingFilter = new DrawingFilter(DataSet.Features, _scheme, 5000);
                _selection = new Selection(featureSet, _drawingFilter);
            }
            else
            {
                _selection = new IndexSelection(this);
            }

            _selection.Changed += SelectedFeaturesChanged;

            _drawnStatesNeeded = false;
        }
Пример #9
0
        /// <summary>
        /// Disposes memory objects
        /// </summary>
        /// <param name="disposeManagedResources">
        /// </param>
        protected override void Dispose(bool disposeManagedResources)
        {
            if (disposeManagedResources)
            {
                ViewAttributes = null;
                LabelSetup = null;
                SnapShotTaken = null;
                SchemeApplied = null;
                _name = null;
                _scheme = null;
                _selection = null;
                _drawingFilter = null;
                _featureSymbolizer = null;
                _selectionFeatureSymbolizer = null;
                _categoryExtents = null;
                _drawnStates = null;
            }

            if (_labelLayer != null)
            {
                _labelLayer.Dispose();
            }

            base.Dispose(disposeManagedResources);
        }
Пример #10
0
 /// <summary>
 /// Creates a new instance of FilterCollection, where the current state of the filter is
 /// recorded as the kind of "collection" that this item belongs to.  The filter can be
 /// altered later, and this will retain the original state.
 /// </summary>
 public FilterCollection(IDrawingFilter inFilter, FilterTypes activeType)
 {
     _filter = inFilter;
     _activeType = activeType;
     Configure();
 }
Пример #11
0
        private void Configure(IFeatureSet featureSet)
        {
            _categoryExtents = new Dictionary<IFeatureCategory, Extent>();
            _drawingBounds = new Rectangle(-32000, -32000, 64000, 64000);
            DataSet = featureSet;
            LegendText = featureSet.Name;
            _name = featureSet.Name;
            ContextMenuItems.Insert(2, new MenuItem("View Attributes", ViewAttributesClick));
            MenuItem label = new MenuItem("Labeling");
            label.MenuItems.Add(new MenuItem("Label Setup", LabelSetupClick));
            label.MenuItems.Add(new MenuItem("Set Dynamic Visibility", LabelExtentsClick));
            ContextMenuItems.Insert(4, label);
            MenuItem selection = new MenuItem("Selection");
            ContextMenuItems.Insert(5, selection);
            selection.MenuItems.Add(new MenuItem("Zoom to Selected Features", SelectionZoomClick));
            selection.MenuItems.Add(new MenuItem("Create Layer from Selected Features", SelectionToLayerClick));
            if (!featureSet.IndexMode) _editMode = true;
            // Categories and selections

            // these are like a stored procedure that only care about the selection and no other drawing characteristics.
            if(_editMode)
            {
                _drawingFilter = new DrawingFilter(DataSet.Features, _scheme, 5000);
                _selection = new Selection(featureSet, _drawingFilter);
            }
            else
            {
                _selection = new IndexSelection(this);
            }
            _selection.Changed += SelectedFeaturesChanged;
            _labelDialog = new LabelSetup();
            _labelDialog.ChangesApplied += LabelDialogChangesApplied;
            _drawnStatesNeeded = false;
           
        }