Esempio n. 1
0
        public DataRepositoryVM(TmM.ITableManagerVM source, AbsM.ERepositoryType type, bool isTable)
        {
            _source = source;
            if (_source != null)
            {
                _mv = source.mv;
            }
            else
            {
                _mv = Program.mainFrm1.axMapLIb1;
            }

            _isTable     = isTable;
            _type        = type;
            _id          = ++_idSource;
            _hasVMWindow = new Dictionary <WindowViewModelBase_VM, Window>();

            _hashTables = new Dictionary <object, AbsM.ITableBaseM>();

            _layers = new ObservableCollection <AbsM.ILayerM>();
            ICollectionView defView = CollectionViewSource.GetDefaultView(_layers);

            defView.Filter = delegate(object o)
            {
                return(!(o as AbsM.TableBaseM).IsHidden);
            };

            _groups     = new ObservableCollection <AbsM.IGroupM>();
            _hashGroups = new Dictionary <object, AbsM.IGroupM>();
            _tables     = new ObservableCollection <AbsM.ITableBaseM>();


            _tables.CollectionChanged += Tables_CollectionChanged;
            _groups.CollectionChanged += Groups_CollectionChanged;
        }
Esempio n. 2
0
        public VMPDataRepositoryVM(TmM.ITableManagerVM source)
            : base(source, AbsM.ERepositoryType.VMP, true)
        {
            _groups.Add(new AbsM.GroupM(this, 0)
            {
                Text = "Группа слоев подложки"
            });

            _bottomLayers = new List <mvLayer>();
            for (int i = 0; i < _mv.LayersCount; i++)
            {
                mvLayer ll = _mv.getLayerByNum(i);
                ll.selectable = false;
                _bottomLayers.Add(ll);
            }
            //ReloadInfo();
            Title = Properties.Resources.LocBaseLayersConfig;
            Text  = Properties.Resources.LocSourceBaseLayers;
        }
        public RastrDataRepositoryVM(TmM.ITableManagerVM source, string pathFile)
            : base(source, AbsM.ERepositoryType.Rastr, false)
        {
            _pathFile      = pathFile;
            Title          = Properties.Resources.LocRastrConfig;
            Text           = Properties.Resources.LocSourceRastr;
            _defaultRastrs = GetDefaultLayers();

            var group = new AbsM.GroupM(this, 0)
            {
                Text = "Группа растровых слоев"
            };
            var group2 = new AbsM.GroupM(this, 1)
            {
                Text = "Группа статичных растровых слоев"
            };

            _groups.Add(group);
            _groups.Add(group2);

            ReloadInfo();
        }