public pnlDictionaryEdtPanelViewModel(IEventAggregator ea, IXmlCompareToolSetting ToolSetting, IXmlCompareUserControl UserControl, IXmlSettingReportDictionary CurrentReportDictionary, IXmlSettingNode _CurrentNode, IXmlSetting CurrentSetting) { _ea = ea; _ea.GetEvent <NodeEvent>().Subscribe(GetNode); _ea.GetEvent <SourceListEvent>().Subscribe(GetSource); _ea.GetEvent <SettingEvent>().Subscribe(GetSetting); _ea.GetEvent <SourceEvent>().Subscribe(GetNodetype); _ToolSetting = ToolSetting; _UserControl = UserControl; CurrentNode = _CurrentNode; _CurrentReportDictionary = CurrentReportDictionary; UpdateCommand = new DelegateCommand(UpdateCommandExecute); DeleteCommand = new DelegateCommand(DeleteCommandExecute); AddCommand = new DelegateCommand(AddCommandExecute); UpdateGeneralCommand = new DelegateCommand(UpdateGeneralCommandExecute); Editable = _UserControl.IsUserHasPriviledge(_UserControl.GetCurrentUser(), "XmlSettingFilePath"); _IssueCategoryList_1.Add(XmlSettingRptDicCategory.ChangedAttribute.ToString()); _IssueCategoryList_1.Add(XmlSettingRptDicCategory.DeletedAttribute.ToString()); _IssueCategoryList_1.Add(XmlSettingRptDicCategory.AddedAttribute.ToString()); _IssueCategoryList_2.Add(XmlSettingRptDicCategory.DeletedChildNode.ToString()); _IssueCategoryList_2.Add(XmlSettingRptDicCategory.AddedChildNode.ToString()); }
public ToolSettingViewModel(IEventAggregator ea, IXmlCompareToolSetting ToolSetting, IXmlSettingCollection CurrentSettingCollection, pnlDictionaryEdtPanelViewModel DictionaryEdtPanel, IXmlCompareUserControl UserControl, IXmlSettingReportDictionary CurrentReportDictionary, IXmlSettingFactorty SettingFact, IRegionManager regionManager, IXmlSettingNode _CurrentNode, IXmlSetting _CurrentSetting) { AddNewTypeCommand = new DelegateCommand <IXmlSettingCollection>(AddNewTypeCommandExecute); DeleteTypeCommand = new DelegateCommand(DeleteTypeCommandExecute); KeyFlagTrueCommand = new DelegateCommand(KeyFlagTrueCommandExecute); KeyFlagFalseCommand = new DelegateCommand(KeyFlagFalseCommandExecute); SaveCommand = new DelegateCommand(SaveCommandExecute); chkMoreCommand = new DelegateCommand(chkMoreCommandExecute); BackCommand = new DelegateCommand(Back); AddAttrCompareFlagCommand = new DelegateCommand(AddAttrCompareFlag); RemoveAttrCompareFlagCommand = new DelegateCommand(RemoveAttrCompareFlag); AddNodeCompareFlagCommand = new DelegateCommand(AddNodeCompareFlag); RemoveNodeCompareFlagCommand = new DelegateCommand(RemoveNodeCompareFlag); CurrentNode = _CurrentNode; _CurrentReportDictionary = CurrentReportDictionary; CurrentSetting = _CurrentSetting; _regionManager = regionManager; m_ToolSetting = ToolSetting; m_UserControl = UserControl; m_SettingFact = SettingFact; m_DictionaryEdtPanel = DictionaryEdtPanel; m_DictionaryEdtPanel = new pnlDictionaryEdtPanelViewModel(ea, m_ToolSetting, m_UserControl, _CurrentReportDictionary, CurrentNode, CurrentSetting); ChkMoreSelected = false; m_CurrentSettingCollection = CurrentSettingCollection; m_CurrentSettingCollection = m_SettingFact.ReadSettingCollection(m_ToolSetting.GetXmlSettingFilePath().Value); _ea = ea; _ea.GetEvent <CollectionEvent>().Subscribe(GetCollection); Flag = m_UserControl.IsUserHasPriviledge(m_UserControl.GetCurrentUser(), "XmlSettingFilePath"); XmlTypeList = new ObservableCollection <string>(m_CurrentSettingCollection.GetAllSettingTypes()); SelectType = null; ChkContent = "Show Report Dictionary Setting"; }
public bool Initialize(out IXmlSettingCollection xmlSettingCollection) { bool result = false; try { CUser user = m_UserControl.GetCurrentUser(); result = m_UserControl.CheckUser(user.Id); if (!result) { m_UserControl.CreateUser(user.Id, user.Name); result = true; } xmlSettingCollection = m_SettingFactory.ReadSettingCollection(m_ToolSetting.GetXmlSettingFilePath().Value); } catch (Exception e) { result = false; xmlSettingCollection = null; System.Windows.MessageBox.Show(e.Message); } return(result); }