/// <summary>
        /// Функция изменения видимости слоя. Возвращает видимость слоя после попытки изменения
        /// </summary>
        /// <param name="table"></param>
        /// <returns></returns>
        internal override bool MakeLayerVisible(AbsM.TableBaseM table, bool?value)
        {
            mvLayer layer = _mv.getLayer(table.Name);

            layer.Visible = value ?? false;
            return(layer.Visible);
        }
예제 #2
0
        internal void SetInvertVisible(object param = null, bool?value = null)
        {
            if (CanSetInvertVisable(param) == false)
            {
                return;
            }
            AbsM.TableBaseM table       = param as AbsM.TableBaseM;
            bool            ExIsVisible = table.IsVisible;

            if (table.IsLayer == false)
            {
                value = false;
            }
            bool IsVisible = MakeLayerVisible(table, value);

            AbsM.TableBaseM.UpdateIsVisible(table, IsVisible);
            if (IsVisible == false)
            {
                table.IsSelectable = false;
            }
            if (ExIsVisible != IsVisible)
            {
                UpdateGroupVisibility();
            }
            _mv.mapRepaint();
        }
예제 #3
0
 public PgStyleObjectM(AbsM.TableBaseM table, object idObject)
 {
     if (table == null)
     {
         throw new ArgumentNullException("table");
     }
     if (idObject == null)
     {
         throw new ArgumentNullException("idObject");
     }
     _table    = table;
     _idObject = idObject;
 }
 /// <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);
     }
 }
        internal override bool MakeLayerEditable(AbsM.TableBaseM table, bool?value)
        {
            var layer = _mv.getLayer(table.Name);

            if (layer != null)
            {
                layer.editable = value ?? false;
                return(layer.editable);
            }
            else
            {
                return(false);
            }
        }
예제 #6
0
        /// <summary>
        /// Функция изменения видимости слоя. Возвращает видимость слоя после попытки изменения
        /// </summary>
        /// <param name="table"></param>
        /// <returns></returns>
        internal override bool MakeLayerVisible(AbsM.TableBaseM table, bool?value)
        {
            var  vmpTable  = table as VMPM.VMPTableBaseModel;
            bool isChecked = (bool)(value);
            var  layer     = _mv.getLayer(table.Name);

            layer.Visible = isChecked;
            if (layer.Visible)
            {
                layer.usebounds = vmpTable.UseBounds;
                layer.MinScale  = (uint)vmpTable.MinScale;
                layer.MaxScale  = (uint)vmpTable.MaxScale;
            }
            return(layer.Visible);
        }
예제 #7
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);
        }
예제 #8
0
        internal virtual void SetInvertEditable(object param = null, bool?value = null)
        {
            if (CanSetInvertEditable(param) == false)
            {
                return;
            }

            AbsM.TableBaseM table = param as AbsM.TableBaseM;

            if (table.IsSelectable == false || table.IsReadOnly)
            {
                value = false;
            }
            bool IsEditable = MakeLayerEditable(table, value);

            AbsM.TableBaseM.UpdateIsEditable(table, IsEditable);
        }
예제 #9
0
        internal void SetInvertSelectable(object param = null, bool?value = null)
        {
            if (CanSetInvertSelectable(param) == false)
            {
                return;
            }

            AbsM.TableBaseM table = param as AbsM.TableBaseM;
            if (table.IsVisible == false)
            {
                value = false;
            }
            bool IsSelectable = MakeLayerSelectable(table, value);

            AbsM.TableBaseM.UpdateIsSelectable(table, IsSelectable);
            if (IsSelectable == false)
            {
                table.IsEditable = false;
            }
        }
예제 #10
0
 internal static void UpdateIsNewTable(TableBaseM table, bool value)
 {
     table.OnPropertyChanged(ref table._isNewTable, value, () => table.IsNewTable);
 }
        /// <summary>
        /// Функция изменения видимости слоя. Возвращает видимость слоя после попытки изменения
        /// </summary>
        /// <param name="table"></param>
        /// <returns></returns>
        internal override bool MakeLayerVisible(AbsM.TableBaseM table, bool?value)
        {
            var  rastrTable = table as RasM.RastTableBaseM;
            bool isChecked  = (bool)(value);

            if (!(table as RasM.RastTableBaseM).IsExternal)
            {
                if (isChecked)
                {
                    try
                    {
                        cti.ThreadProgress.ShowWait();

                        //todo задача #3646
                        _mv.LoadLayer(rastrTable.FilePath, true);
                        var imLayer = _mv.getImageLayer(rastrTable.FilePath);
                        if (imLayer != null)
                        {
                            imLayer.bgcolor = (uint)Program.bgMap;
                        }
                        return(imLayer != null);
                    }
                    finally
                    {
                        cti.ThreadProgress.Close();
                    }
                }
                else
                {
                    var imLayer = _mv.getImageLayer(rastrTable.FilePath);
                    if (imLayer != null)
                    {
                        _mv.deleteImageLayer(imLayer);
                    }
                }
            }
            else
            {
                if (isChecked)
                {
                    try
                    {
                        cti.ThreadProgress.ShowWait();
                        return(_mv.LoadExternalImageLayer(rastrTable.FilePath, true));
                    }
                    finally
                    {
                        cti.ThreadProgress.Close();
                    }
                }
                else
                {
                    var imextLayer = _mv.GetExternalImageLayer(rastrTable.FilePath);
                    if (imextLayer != null)
                    {
                        return(_mv.DeleteExternalImageLayer(rastrTable.FilePath));
                    }
                }
            }
            return(isChecked);
        }
예제 #12
0
 internal virtual bool MakeLayerEditable(AbsM.TableBaseM table, bool?value)
 {
     return(false);
 }