internal void SetGroupVisible(object param = null, bool?value = null) { AbsM.GroupM group = param as AbsM.GroupM; bool? IsVisible = MakeGroupVisible(group, value); AbsM.GroupM.UpdateIsVisible(group, IsVisible); }
public CosmeticDataRepositoryVM(ITableManagerVM source) : base(source, AbsM.ERepositoryType.Cosmetic, true) { Title = Properties.Resources.LocCosmeticConfig; Text = Properties.Resources.LocSourceCosmetic; var group = new AbsM.GroupM(this, 0) { Text = "Группа косметических слоев" }; _groups.Add(group); ReloadInfo(); }
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(); }
public override ValidationResult Validate(object value, CultureInfo cultureInfo) { BindingGroup bindingGroup = (BindingGroup)value; if (bindingGroup.Items.Count > 0) { AbsM.GroupM group = bindingGroup.Items[0] as AbsM.GroupM; if (group != null) { object groupText = null; bindingGroup.TryGetValue(group, "Text", out groupText); if (!String.IsNullOrEmpty((String)(groupText))) { return(ValidationResult.ValidResult); } else { return(new ValidationResult(false, "Название группы в пользовательском интерфейсе не должно быть пустым")); } } } return(ValidationResult.ValidResult); }
/// <summary> /// Создание новой группый /// </summary> public void NewGroup(object parameter = null) { CurrentGroup = null; CurrentGroup = new AbsM.GroupM(_source); }
internal virtual bool?MakeGroupVisible(AbsM.GroupM group, bool?value) { if (value == false) { ObservableCollection <AbsM.TableBaseM> tempCol = new ObservableCollection <AbsM.TableBaseM>(); foreach (AbsM.TableBaseM lr in group.Tables) { tempCol.Add(lr); } foreach (AbsM.TableBaseM lr in tempCol) { if (lr.IsVisible != false && !lr.IsHidden) { lr.IsVisible = false; } } tempCol.Clear(); } else if (value == true) { int visibleLayersCount = 0; int totalLayersCount = 0; try { for (int i = 0; i < group.Tables.Count; i++) { if (group.Tables[i].IsVisible != true && !group.Tables[i].IsHidden) { group.Tables[i].IsVisible = true; } if (!group.Tables[i].IsHidden) { totalLayersCount++; if (group.Tables[i].IsVisible) { visibleLayersCount++; } } } } catch (Exception ex) { System.Diagnostics.Debug.Print("Возникло исключение в методе MakeGroupVisible()\n" + ex.Message); throw ex; } finally { if (visibleLayersCount == 0) { value = false; } else if (visibleLayersCount < totalLayersCount) { value = null; } else if (visibleLayersCount == totalLayersCount) { value = true; } } } else { value = null; } return(value); }
internal static ObservableCollection <AbsM.ILayerM> GetTables(GroupM group) { return(group._tables); }
internal static void UpdateIsVisible(GroupM group, bool?value) { group.OnPropertyChanged(ref group._isVisible, value, () => group.IsVisible); }