void m_DeleteCalcMemberButton_Click(object sender, RoutedEventArgs e) { if (MessageBox.Show(Localization.DeleteCurrent_Question, Localization.Warning, MessageBoxButton.OKCancel) == MessageBoxResult.OK) { CalcMemberInfo memberInfo = MembersList.CurrentObject as CalcMemberInfo; if (memberInfo != null) { Members.Remove(memberInfo.Name); MembersList.RemoveItem(memberInfo); } else { CalculatedNamedSetInfo setInfo = MembersList.CurrentObject as CalculatedNamedSetInfo; if (setInfo != null) { Sets.Remove(setInfo.Name); MembersList.RemoveItem(setInfo); } } m_ClearButton.IsEnabled = (Members.Count + Sets.Count) > 0; RefreshMetadataTree(); } return; }
void RefreshMetadataTree() { List <CalcMemberInfo> members = new List <CalcMemberInfo>(); foreach (CalculationInfoBase info in Members.Values) { CalcMemberInfo memberInfo = info as CalcMemberInfo; if (memberInfo != null) { members.Add(memberInfo); } } List <CalculatedNamedSetInfo> sets = new List <CalculatedNamedSetInfo>(); foreach (CalculationInfoBase info in Sets.Values) { CalculatedNamedSetInfo setInfo = info as CalculatedNamedSetInfo; if (setInfo != null) { sets.Add(setInfo); } } CubeBrowser.CalculatedMembers = members; CubeBrowser.CalculatedNamedSets = sets; }
public override object Clone() { CalculatedNamedSetInfo ret = new CalculatedNamedSetInfo(); ret.Name = Name; ret.Expression = Expression; return ret; }
public override object Clone() { CalculatedNamedSetInfo ret = new CalculatedNamedSetInfo(); ret.Name = Name; ret.Expression = Expression; return(ret); }
public void Initialize(CalculatedNamedSetInfo info) { this.IsEnabled = info != null; m_Set = info; txtName.Text = info != null ? info.Name : String.Empty; txtExpression.Text = info != null ? info.Expression : String.Empty; }
public CalculatedNamedSetTreeNode(CalculatedNamedSetInfo info) { if (info == null) throw new ArgumentNullException("info"); Icon = UriResources.Images.CustomNamedSet16; Text = info.Name; m_Info = info; }
void m_AddNamedSetButton_Click(object sender, RoutedEventArgs e) { CalculatedNamedSetInfo info = new CalculatedNamedSetInfo(); info.Name = BuildNewCalculatedNamedSetName(String.Empty); Sets.Add(info.Name, info); MembersList.Initialize(Members, Sets, info); RefreshMetadataTree(); m_ClearButton.IsEnabled = (Members.Count + Sets.Count) > 0; }
void MembersList_SelectionChanged(object sender, SelectionChangedEventArgs <CalculationInfoBase> e) { EndEdit(); MemberCtrl.IsEnabled = SetCtrl.IsEnabled = e.NewValue != null; if (e.NewValue == null) { if (MemberCtrl.Visibility == Visibility.Visible) { MemberCtrl.Initialize(null); } if (SetCtrl.Visibility == Visibility.Visible) { SetCtrl.Initialize(null); } } CalcMemberInfo memberInfo = e.NewValue as CalcMemberInfo; if (memberInfo != null) { MemberCtrl.Visibility = Visibility.Visible; SetCtrl.Visibility = Visibility.Collapsed; MemberCtrl.Initialize(memberInfo); } CalculatedNamedSetInfo setInfo = e.NewValue as CalculatedNamedSetInfo; if (setInfo != null) { MemberCtrl.Visibility = Visibility.Collapsed; SetCtrl.Visibility = Visibility.Visible; SetCtrl.Initialize(setInfo); } m_DeleteCalcMemberButton.IsEnabled = e.NewValue != null; }
public CalculatedNamedSet_AreaItemWrapper(CalculatedNamedSetInfo info) : base(info) { }