public void SetUserClass(bool DebugFlag, bool ReloadFlag) { this.usr = User.CreateInstance(); this.usrenv = UserEnvironment.CreateInstance(); this.HSearchList = this.usr.HistorySearchList; this.SearchListSet(); this.cmbSearchDiv.SelectedIndex = 0; this.msgc = MessageClassify.CreateInstance(); this.trmlist = this.msgc.TermList; this.FldList = this.msgc.Folders; this.FolderSet(); this.DBFixAdd(); this.pi = PathInfo.CreateInstance(); if (ReloadFlag) { string path = this.pi.DataViewPath + "Data.xml"; string str2 = ""; if (File.Exists(path)) { str2 = File.GetLastWriteTime(path).ToString("yyyy/MM/dd HH:mm:ss", DateTimeFormatInfo.InvariantInfo); } string upTime = this.msgc.DataView.upTime; bool flag = (upTime == null) || (str2.CompareTo(upTime) > 0); bool flag2 = true; if (!flag) { if (DebugFlag) { DialogResult result; using (MessageDialog dialog = new MessageDialog()) { result = dialog.ShowMessage("W403", null, null); } if (result == DialogResult.No) { flag2 = false; } } else { using (MessageDialog dialog2 = new MessageDialog()) { dialog2.ShowMessage("W404", null, null); } } } try { this.msgc.DataView.upTime = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss", DateTimeFormatInfo.InvariantInfo); this.msgc.Save(); } catch (Exception exception) { MessageDialog dialog3 = new MessageDialog(); dialog3.ShowMessage("E304", Resources.ResourceManager.GetString("CORE106"), null, exception); dialog3.Close(); dialog3.Dispose(); } if (flag || (!flag && !flag2)) { TreeNode selectedNode = this.tvSendRecvFolder.SelectedNode; this.tvSendRecvFolder.SelectedNode = this.tvSendRecvFolder.Nodes[0]; this.dtsDataView.Clear(); if (str2 != "") { try { this.dtsDataView.Tables[0].BeginLoadData(); try { this.dtsDataView.ReadXml(path); } finally { this.dtsDataView.Tables[0].EndLoadData(); } this.MaxID = this.GetID(); } catch (Exception exception2) { MessageDialog dialog4 = new MessageDialog(); dialog4.ShowMessage("E403", path, null, exception2); dialog4.Dispose(); this.ViewRepair(true); } } this.tvSendRecvFolder.SelectedNode = selectedNode; } else { this.ViewRepair(true); } } this.fs = FileSave.CreateInstance(); UserKeySet set = new UserKeySet(); set.ShortCutSet(this.rmnDataView.Items); set.ShortCutSet(this.rmnSendRecvFolder.Items); }
public void SetMsgc() { this.msgc = MessageClassify.CreateInstance(); this.trmlist = this.msgc.TermList; }