Ejemplo n.º 1
0
        public CosmeticTableViewVM(CosmeticTableBaseM cosTable)
        {
            this.MoveToObject = false;
            _axMapLib         = (cosTable.Source as CosmeticDataRepositoryVM).MapViewer;
            _mvLayer          = _axMapLib.getLayer(cosTable.Name);
            _cosTable         = cosTable;
            _isReadOnly       = true;
            _filterVM         = new CosmeticTableViewFilterVM(this, null);
            Title             = String.Format("{0}: \"{1}\"", Rekod.Properties.Resources.CosTableView_CosmeticLayer, cosTable.Text);

            foreach (var field in _cosTable.Fields)
            {
                if (field.Type != AbsM.EFieldType.Geometry)
                {
                    DataColumn dc = new DataColumn(field.Name, typeof(String));
                    Data.Columns.Add(dc);
                    if (cosTable.PrimaryKeyField == field)
                    {
                        dc.ReadOnly     = true;
                        Data.PrimaryKey = new[] { dc };
                    }
                }
            }

            GetColumns();
            Reload();

            PropertyChanged += CosmeticTableViewVM_PropertyChanged;
            SelectedItems.CollectionChanged += SelectedItems_CollectionChanged;
            Reload();
        }
 /// <summary>
 /// Функция изменения выбираемости слоя. Возвращает true если слой существует и выбираемый
 /// </summary>
 /// <param name="table"></param>
 /// <param name="value"></param>
 /// <returns></returns>
 internal override bool MakeLayerSelectable(AbsM.TableBaseM table, bool?value)
 {
     mvMapLib.mvLayer layer = _mv.getLayer(table.Name);
     if (layer != null)
     {
         layer.selectable = value ?? false;
         return(layer.selectable);
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Функция изменения выбираемости слоя. Возвращает true если слой существует и выбираемый
        /// </summary>
        /// <param name="table"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        internal override bool MakeLayerSelectable(AbsM.TableBaseM table, bool?value)
        {
            bool isChecked = (bool)(value);

            mvMapLib.mvLayer layer = _mv.getLayer(table.Name);
            if (layer != null)
            {
                layer.selectable = isChecked;

                isChecked = layer.selectable;
            }
            else
            {
                isChecked = false;
            }
            return(isChecked);
        }