コード例 #1
0
ファイル: ConfigFiles.cs プロジェクト: huamanhtuyen/VNACCS
 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();
 }
コード例 #2
0
ファイル: UserPathNames.cs プロジェクト: huamanhtuyen/VNACCS
 public static UserPathNames CreateInstance(PathInfo pathInfo)
 {
     if (singletonInstance == null)
     {
         if (pathInfo == null)
         {
             pathInfo = PathInfo.CreateInstance();
         }
         singletonInstance = AbstractConfig.Load(typeof(UserPathNames), ExtraTypes, pathInfo.UserPathNamesPath) as UserPathNames;
         if (singletonInstance == null)
         {
             singletonInstance = new UserPathNames();
             singletonInstance.Initialize();
         }
     }
     return singletonInstance;
 }
コード例 #3
0
 public static SystemEnvironment CreateInstance(PathInfo pathInfo)
 {
     if (singletonInstance == null)
     {
         if (pathInfo == null)
         {
             pathInfo = PathInfo.CreateInstance();
         }
         singletonInstance = AbstractConfig.Load(typeof(SystemEnvironment), ExtraTypes, pathInfo.SystemEnvironmentSetup) as SystemEnvironment;
         if (singletonInstance == null)
         {
             singletonInstance = new SystemEnvironment();
             singletonInstance.Initialize();
         }
     }
     return singletonInstance;
 }
コード例 #4
0
ファイル: User.cs プロジェクト: huamanhtuyen/VNACCS
 public static User CreateInstance(PathInfo pathInfo)
 {
     if (singletonInstance == null)
     {
         if (pathInfo == null)
         {
             pathInfo = PathInfo.CreateInstance();
         }
         singletonInstance = AbstractConfig.Load(typeof(User), ExtraTypes, pathInfo.UserSetup) as User;
         if (singletonInstance == null)
         {
             singletonInstance = new User();
             singletonInstance.Initialize();
         }
         singletonInstance.Application.OnSettingDivChanged += new EventHandler(singletonInstance.SettingDivChanged);
     }
     return singletonInstance;
 }
コード例 #5
0
ファイル: PathInfo.cs プロジェクト: huamanhtuyen/VNACCS
 public static PathInfo ResetInstance()
 {
     string path = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "PathNames.xml");
     if (File.Exists(path))
     {
         XmlSerializer serializer = new XmlSerializer(typeof(PathInfo));
         FileStream input = new FileStream(path, FileMode.Open);
         XmlReader xmlReader = XmlReader.Create(input);
         pathInfoInstance = (PathInfo) serializer.Deserialize(xmlReader);
         input.Close();
     }
     else
     {
         pathInfoInstance = new PathInfo();
     }
     SystemEnvironment environment = SystemEnvironment.CreateInstance(pathInfoInstance);
     if (environment.TerminalInfo.Demo)
     {
         pathInfoInstance.thisUserAppData = pathInfoInstance.appdatapath + @"\NACCSTraining\";
         pathInfoInstance.allUserAppData = pathInfoInstance.commonapppath + @"\NACCSTraining\";
     }
     else if (environment.TerminalInfo.Receiver)
     {
         pathInfoInstance.thisUserAppData = pathInfoInstance.appdatapath + @"\NACCSReceiver\";
         pathInfoInstance.allUserAppData = pathInfoInstance.commonapppath + @"\NACCSReceiver\";
     }
     else if (environment.TerminalInfo.UserKind == 4)
     {
         pathInfoInstance.thisUserAppData = pathInfoInstance.appdatapath + @"\NACCSPrivate\";
         pathInfoInstance.allUserAppData = pathInfoInstance.commonapppath + @"\NACCSPrivate\";
     }
     else
     {
         pathInfoInstance.thisUserAppData = pathInfoInstance.appdatapath + pathInfoInstance.projectpath;
         pathInfoInstance.allUserAppData = pathInfoInstance.commonapppath + pathInfoInstance.projectpath;
     }
     pathInfoInstance.Protocol = environment.TerminalInfo.Protocol;
     User user = User.CreateInstance();
     user.OnSettingEnvChanged += new EventHandler(pathInfoInstance.user_OnSettingEnvChanged);
     pathInfoInstance.SettingDiv = user.Application.SettingsDiv;
     pathInfoInstance.IsSettingDivChanged = false;
     JobConfigFactory.TemplatePath = pathInfoInstance.TemplateRoot;
     HelpSettings.CreateInstance();
     return pathInfoInstance;
 }
コード例 #6
0
ファイル: OptionDialog.cs プロジェクト: huamanhtuyen/VNACCS
 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();
 }
コード例 #7
0
ファイル: OptionDialog.cs プロジェクト: huamanhtuyen/VNACCS
 private void DlgRes_Yes()
 {
     messageClassify.Save();
     user.Application.SettingsDiv = this.DivType;
     user.Save();
     pathInfo = PathInfo.ResetInstance();
     messageClassify = MessageClassify.ResetInstance();
     this.LoadMsgCls();
     optionCertification = OptionCertification.ResetInstance();
     this.LoadPassword();
     this.btnRootAcpt_Click(null, new EventArgs());
 }
コード例 #8
0
ファイル: OptionDialog.cs プロジェクト: huamanhtuyen/VNACCS
 private bool CommonFolderSwitch(bool specify, string folder)
 {
     if (this.ShowModalMessage("C505", null, null) == DialogResult.Cancel)
     {
         return false;
     }
     string commonPath = pathInfo.CommonPath;
     string dest = pathInfo.UserCommonPath(specify, folder);
     if (!specify && !Directory.Exists(commonPath))
     {
         this.ShowModelessMessage("E577", commonPath, null);
         return false;
     }
     if (!this.TabPage_Save())
     {
         this.ShowModelessMessage("E576", commonPath, null);
         return false;
     }
     if (Directory.Exists(commonPath))
     {
         this.Cursor = Cursors.WaitCursor;
         try
         {
             this.CopyFolder(commonPath, dest);
             try
             {
                 Directory.Delete(commonPath, true);
             }
             catch (Exception exception)
             {
                 this.ShowModelessMessage("E579", commonPath, MessageDialog.CreateExceptionMessage(exception));
             }
         }
         catch (Exception exception2)
         {
             this.ShowModelessMessage("E578", commonPath, MessageDialog.CreateExceptionMessage(exception2));
             return false;
         }
         finally
         {
             this.Cursor = Cursors.Default;
         }
     }
     UserPathNames names = UserPathNames.CreateInstance();
     names.CommonPath.Specify = specify;
     names.CommonPath.Folder = folder;
     names.Save();
     names = UserPathNames.ResetInstance();
     pathInfo = PathInfo.ResetInstance();
     ConfigFiles.AllReset();
     this.TabPage_Load();
     return true;
 }
コード例 #9
0
ファイル: MainBase.cs プロジェクト: huamanhtuyen/VNACCS
 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();
 }
コード例 #10
0
ファイル: MainBase.cs プロジェクト: huamanhtuyen/VNACCS
 public MainBase(bool proxyError)
 {
     this.MiList = new List<ToolStripMenuItem>();
     this.ProtocolName = "";
     this.isDesigning = (AppDomain.CurrentDomain.FriendlyName == "DefaultDomain") && !ApplicationDeployment.IsNetworkDeployed;
     this.InitializeComponent();
     if (!this.isDesigning)
     {
         this.uopd = new UOpeningDlg();
         this.uopd.TopMost = true;
         this.uopd.StartPosition = FormStartPosition.CenterScreen;
         this.uopd.Show();
         Application.DoEvents();
         this.pi = PathInfo.CreateInstance();
         this.UserPathAuth();
         this.AuthorityChange();
         this.isProxyError = proxyError;
         this.OptionCheck();
         new ResourceManager().ResourceCopy();
         new VersionuptoolUpdater().Excute(this.VersioupToolPath);
         this.uJobInput1.OnJobOpen += new JobOpenHandler(this.JobWindow_OnJobOpen);
         this.uJobMenu1.OnJobOpen += new JobOpenMenuHandler(this.JobWindow_OnJobOpen);
         this.pr = new PrintManager();
         this.pr.OnPrintEnd += new OnPrintEndHandler(this.Print_OnPrintEnd);
         this.pr.OnPrintError += new OnPrintErrorHandler(this.Print_OnPrintError);
         Application.ThreadException += new ThreadExceptionEventHandler(this.Application_ThreadException);
         this.mnOption.DropDownItems.Remove(this.mnListRestriction);
     }
 }
コード例 #11
0
ファイル: UJobInputDlg.cs プロジェクト: huamanhtuyen/VNACCS
 public UJobInputDlg()
 {
     this.InitializeComponent();
     this.pi = PathInfo.CreateInstance();
     this.dcl = new DispCodeList();
 }
コード例 #12
0
ファイル: UJobMenu.cs プロジェクト: huamanhtuyen/VNACCS
 public void JobMenuSet()
 {
     this.pi = PathInfo.CreateInstance();
     this.fs = FileSave.CreateInstance();
 }
コード例 #13
0
ファイル: UDataView.cs プロジェクト: huamanhtuyen/VNACCS
 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);
 }
コード例 #14
0
ファイル: UJobInput.cs プロジェクト: huamanhtuyen/VNACCS
 private void UJobInput_Load(object sender, EventArgs e)
 {
     if (!this.isDesigning)
     {
         this.pi = PathInfo.CreateInstance();
         this.dcl = new DispCodeList();
     }
 }