Exemplo n.º 1
0
 public static UserEnvironment ResetInstance()
 {
     PathInfo info = PathInfo.CreateInstance();
     singletonInstance = AbstractConfig.Load(typeof(UserEnvironment), ExtraTypes, info.UserEnvironmentSetup) as UserEnvironment;
     if (singletonInstance == null)
     {
         singletonInstance = new UserEnvironment();
         singletonInstance.Initialize();
     }
     return singletonInstance;
 }
Exemplo n.º 2
0
 public static void AllReset()
 {
     pathInfo = PathInfo.ResetInstance();
     systemEnvironment = SystemEnvironment.ResetInstance();
     user = User.ResetInstance();
     userEnvironment = UserEnvironment.ResetInstance();
     optionCertification = OptionCertification.ResetInstance();
     printerSettings = PrintSetups.ResetInstance();
     messageClassify = MessageClassify.ResetInstance();
     helpSettings = HelpSettings.ResetInstance();
     fileSave = FileSave.ResetInstance();
     receiveNotice = ReceiveNotice.ResetInstance();
     userKey = UserKey.ResetInstance();
     termMessage = TermMessage.ResetInstance();
     gStamp = GStampSettings.ResetInstance();
 }
Exemplo n.º 3
0
 protected virtual void TabPage_Load()
 {
     ConfigFiles.AllLoad();
     pathInfo = ConfigFiles.pathInfo;
     user = ConfigFiles.user;
     userKey = ConfigFiles.userKey;
     this.saveUserKey = ConfigFiles.userKey;
     printSetups = ConfigFiles.printerSettings;
     userEnvironment = ConfigFiles.userEnvironment;
     messageClassify = ConfigFiles.messageClassify;
     fileSave = ConfigFiles.fileSave;
     receiveNotice = ConfigFiles.receiveNotice;
     helpSettings = ConfigFiles.helpSettings;
     optionCertification = ConfigFiles.optionCertification;
     gStamp = ConfigFiles.gStamp;
     this.LoadTerm();
     this.LoadServer();
     this.LoadPrinter();
     this.LoadAutoPrint();
     this.LoadMsgCls();
     this.LoadFileSaveK();
     this.LoadFileSaveC();
     this.LoadReceiveInform();
     this.LoadUserKey();
     this.LoadLog();
     this.LoadHelp();
     this.LoadPassword();
 }
Exemplo n.º 4
0
 private void OptionSet(bool ReloadFlag)
 {
     this.usrenv = UserEnvironment.CreateInstance();
     if (this.sysenv.TerminalInfo.Protocol == ProtocolType.Mail)
     {
         this.ProtocolName = this.sysenv.MailInfo.SelectServer(this.usrenv.MailInfo.ServerConnect).display;
     }
     else
     {
         this.ProtocolName = this.sysenv.InteractiveInfo.SelectServer(this.usrenv.InteractiveInfo.ServerConnect).display;
     }
     if (this.SeqList == null)
     {
         this.stbInfomation.Text = this.ProtocolName;
         this.stbInfomation.Font = new Font(this.stbInfomation.Font, FontStyle.Regular);
     }
     this.usrenv_term = this.usrenv.TerminalInfo;
     this.stbTerm.Text = this.usrenv_term.TermLogicalName;
     this.SendRecvTimer = this.usrenv.InteractiveInfo.AutoSendRecvTm;
     this.SendRecvTimerFlg = this.usrenv.InteractiveInfo.AutoSendRecvMode;
     this.JobConnectSet();
     this.JobConnect = this.usrenv.InteractiveInfo.JobConnect;
     this.AutoSendRecvFlag = this.usrenv.MailInfo.AutoMode;
     this.AutoSendRecvTimer = this.usrenv.MailInfo.AutoTm;
     this.AutoSendRecvKind = this.usrenv.MailInfo.AutoTmKind;
     if (this.AutoSendRecvTimer > 0)
     {
         this.tmrSendRecv.Interval = (this.AutoSendRecvTimer * 60) * 0x3e8;
     }
     else
     {
         this.AutoSendRecvFlag = false;
     }
     this.tmrSendRecv.Enabled = this.AutoSendRecvFlag;
     this.fsc = FileSave.CreateInstance();
     this.msgc = MessageClassify.CreateInstance();
     this.JobKeySet();
     new UserKeySet().ShortCutSet(this.mnMainMenu.Items);
     this.FunctionSet(0);
     this.idv.SetUserClass(this.sysenv.TerminalInfo.Debug, ReloadFlag);
 }
Exemplo n.º 5
0
 private void OptionCheck()
 {
     this.sysenv = SystemEnvironment.CreateInstance();
     this.DemoFlag = this.sysenv.TerminalInfo.Demo;
     this.usrenv = UserEnvironment.CreateInstance();
     if (((this.usrenv.TerminalInfo.TermLogicalName == null) || (this.usrenv.TerminalInfo.TermLogicalName == "")) || ((this.sysenv.TerminalInfo.Protocol != ProtocolType.Mail) && ((this.usrenv.TerminalInfo.TermAccessKey == null) || (this.usrenv.TerminalInfo.TermAccessKey == ""))))
     {
         OptionDialog dialog = (OptionDialog) this.CreateOption();
         this.uopd.Hide();
         dialog.ShowDialog();
         this.usrenv = UserEnvironment.CreateInstance();
         if (((this.usrenv.TerminalInfo.TermLogicalName == null) || (this.usrenv.TerminalInfo.TermLogicalName == "")) || ((this.sysenv.TerminalInfo.Protocol != ProtocolType.Mail) && ((this.usrenv.TerminalInfo.TermAccessKey == null) || (this.usrenv.TerminalInfo.TermAccessKey == ""))))
         {
             dialog.Dispose();
             Environment.Exit(0);
         }
         dialog.Dispose();
         this.uopd.Show();
         Application.DoEvents();
     }
     else if (this.isProxyError)
     {
         OptionDialog dialog2 = (OptionDialog) this.CreateOption();
         this.uopd.Hide();
         dialog2.DefaultTab = dialog2.tbcRoot.TabPages[1];
         DialogResult result = dialog2.ShowDialog();
         this.usrenv = UserEnvironment.CreateInstance();
         dialog2.Dispose();
         if (result == DialogResult.OK)
         {
             string fileName = Path.Combine(Application.StartupPath, @"Download\NaccsLauncher.exe");
             new Process();
             Process.Start(fileName, "-U");
             this.VersionUpFlag = true;
         }
         Environment.Exit(0);
         Application.DoEvents();
     }
 }
Exemplo n.º 6
0
 private void mnSystem_Click(object sender, EventArgs e)
 {
     this.TimerStop();
     this.bOptionShowingFlag = true;
     try
     {
         SettingDivType settingsDiv = this.usr.Application.SettingsDiv;
         string dataViewPath = this.pi.DataViewPath;
         if (this.DsArrangeManager != null)
         {
             this.DsArrangeManager.Dispose();
         }
         using (OptionDialog dialog = (OptionDialog) this.CreateOption())
         {
             dialog.IsLogOn = this.ComStatus > 0;
             if (!dialog.IsLogOn)
             {
                 this.idv.DataViewListSave(dataViewPath);
             }
             if (dialog.ShowDialog() == DialogResult.OK)
             {
                 this.usr = User.CreateInstance();
                 this.pi = PathInfo.CreateInstance();
                 bool reloadFlag = settingsDiv != this.usr.Application.SettingsDiv;
                 if (!reloadFlag)
                 {
                     reloadFlag = this.pi.DataViewPath != dataViewPath;
                 }
                 this.OptionSet(reloadFlag);
                 this.OptionSetProc();
                 this.OptionSetInd();
                 this.idv.SetOpenViewFlag(this.mnVisibleCount.Checked);
                 this.idv.ViewCountCheck(true);
                 this.uJobMenu1.JobMenuSet();
                 this.UpdateMenuItems();
                 this.idv.DataViewRepaint(true);
             }
             else
             {
                 this.usrenv = UserEnvironment.CreateInstance();
                 if (((this.usrenv.TerminalInfo.TermLogicalName == null) || (this.usrenv.TerminalInfo.TermLogicalName == "")) || ((this.sysenv.TerminalInfo.Protocol != ProtocolType.Mail) && ((this.usrenv.TerminalInfo.TermAccessKey == null) || (this.usrenv.TerminalInfo.TermAccessKey == ""))))
                 {
                     Environment.Exit(0);
                 }
             }
         }
     }
     finally
     {
         this.bOptionShowingFlag = false;
     }
     this.TimerStart();
 }
Exemplo n.º 7
0
 private void MainBase_Load(object sender, EventArgs e)
 {
     if (!this.isDesigning)
     {
         this.DiskCheck();
         this.DataInfoCnt = 0;
         this.usr = User.CreateInstance();
         this.HJobList = this.usr.HistoryJobsList;
         this.HUserList = this.usr.HistoryUserList;
         this.HMailBoxList = this.usr.HistoryAddressList;
         this.usr_apc = this.usr.Application;
         this.usr_tlb = this.usr.ToolBar;
         this.usr_wnd = this.usr.Window;
         this.usr_cwc = this.usr.ColumnWidth;
         this.usr_dvf = this.usr.DataViewForm;
         this.usr_jpc = this.usr.JobOption;
         this.usrenv = UserEnvironment.CreateInstance();
         this.OptionSet(true);
         this.idv.RecvFolderSelect();
         this.FldList = this.msgc.Folders;
         if (this.idv.GetCount(4, this.usrenv.TerminalInfo.SaveTerm) > 0)
         {
             MessageDialog dialog = new MessageDialog {
                 TopMost = true
             };
             if (dialog.ShowMessage("C402", this.usrenv.TerminalInfo.SaveTerm.ToString(), "") == DialogResult.Yes)
             {
                 this.idv.SaveDateDataDelete(this.usrenv.TerminalInfo.SaveTerm);
             }
             dialog.Close();
             dialog.Dispose();
             this.uopd.Show();
             Application.DoEvents();
         }
         this.uJobInput1.HistoryJobListSet(this.HJobList);
         this.uJobMenu1.HistoryJobListSet(this.HJobList);
         this.dscl = new DispCodeList();
         this.LoadUserApplication();
         this.mnJobKey.Visible = false;
         int userKind = this.sysenv.TerminalInfo.UserKind;
         if ((this.sysenv.TerminalInfo.UserKind != 4) && !this.sysenv.TerminalInfo.Receiver)
         {
             this.DsArrangeManager = new ArrangeManager(this, this.idv);
             this.DsArrangeManager.AppendArrangeMenu(this.mnOption);
             this.DsArrangeManager.AutoRun();
         }
         this.tbbJetras.Visible = this.sysenv.TerminalInfo.Jetras;
         this.tbbJSplitter5.Visible = this.sysenv.TerminalInfo.Jetras;
         this.DisposingFlag = false;
         this.swtbl = new SWCheckTbl();
         ULogClass.LogWrite("=====< Log Start >=====");
         this.StatusChange(0);
         this.UpdateMenuItems();
         this.uopd.Close();
         this.uopd.Dispose();
     }
 }
Exemplo n.º 8
0
 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);
 }