예제 #1
0
        private void LoadTreeListForTicket(string pTicket)
        {
            //Original stub -- reads sample data from file system directories
            string       currentDir       = Path.Combine(Properties.Settings.Default.TestRootDir, pTicket);
            string       propsFileName    = pTicket + "." + PROPS;
            string       propsFileAndPath = Path.Combine(currentDir, propsFileName);
            PropSettings configFile       = new PropSettings(propsFileAndPath);

            treeListDocs.Nodes.Clear();

            string[] fileEntries = Directory.GetFiles(currentDir);
            foreach (string fileName in fileEntries)
            {
                string fileExt = Path.GetExtension(fileName).Remove(0, 1).ToUpper();
                if (fileExt != PROPS.ToUpper())
                {
                    string docCategory = Path.GetFileNameWithoutExtension(fileName);
                    docCategory = docCategory.Substring(0, docCategory.IndexOf("_"));

                    string fileNameWithoutPath = Path.GetFileName(fileName);
                    string docMetaData         = configFile.get(fileNameWithoutPath, "[None]");
                    treeListDocs.AppendNode(new object[] { docCategory, docMetaData, fileExt, fileName }, -1);
                }
            }

            CloseAllOpenForms();
        }
예제 #2
0
        private void frmVaultViewer_Load(object sender, EventArgs e)
        {
            string roamingFolderLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                                                        PRODUCT_COMPANY, PRODUCT_BRAND);

            appSettingsDir = Path.Combine(roamingFolderLocation, PRODUCT_NAME, PRODUCT_SETTINGS);
            //dataDir = Path.Combine(roamingFolderLocation, PRODUCT_NAME, PRODUCT_DATA);
            //appTempDir = Path.Combine(roamingFolderLocation, PRODUCT_NAME, PRODUCT_TEMP);

            if (!Directory.Exists(appSettingsDir))
            {
                Directory.CreateDirectory(appSettingsDir);
            }

            //load
            userSettingsFile = appSettingsDir + @"\VaultViewer.properties";
            PropSettings config = new PropSettings(userSettingsFile);

            //get value whith default value
            this.Top    = Convert.ToInt32(config.get("MainFormPos_Top", "200"));
            this.Left   = Convert.ToInt32(config.get("MainFormPos_Left", "800"));
            this.Height = Convert.ToInt32(config.get("MainFormPos_Height", "450"));
            this.Width  = Convert.ToInt32(config.get("MainFormPos_Width", "400"));

            colCategory.Width = Convert.ToInt32(config.get("CategoryColumn_Width", "150"));
            colMetadata.Width = Convert.ToInt32(config.get("CategoryMetadata_Width", "400"));

            string formIsTopmost = config.get("MainFormPos_StayOnTop", "FALSE");

            checkEditStayOnTop.Checked = (formIsTopmost == "TRUE") ? true : false;
            this.TopMost = checkEditStayOnTop.Checked ? true : false;

            docViewerExtList.Add("DOC");
            docViewerExtList.Add("DOCX");
            docViewerExtList.Add("RTF");
            docViewerExtList.Add("HTML");
            docViewerExtList.Add("TXT");

            //PopulateTicketList();
            PopulateTradingSysList();
        }
예제 #3
0
        private void frmVaultViewer_FormClosed(object sender, FormClosedEventArgs e)
        {
            PropSettings config = new PropSettings(userSettingsFile);

            config.set("MainFormPos_Top", this.Top.ToString());
            config.set("MainFormPos_Left", this.Left.ToString());
            config.set("MainFormPos_Height", this.Height.ToString());
            config.set("MainFormPos_Width", this.Width.ToString());
            config.set("CategoryColumn_Width", colCategory.Width.ToString());
            config.set("CategoryMetadata_Width", colMetadata.Width.ToString());

            string formIsTopmost = (checkEditStayOnTop.Checked == true) ? "TRUE" : "FALSE";

            config.set("MainFormPos_StayOnTop", formIsTopmost);

            config.Save();

            Process pro = (Process.GetCurrentProcess());

            pro.Kill();
        }
예제 #4
0
        private void frmVaultViewer_Load(object sender, EventArgs e)
        {
            string roamingFolderLocation = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                PRODUCT_COMPANY, PRODUCT_BRAND);
            appSettingsDir = Path.Combine(roamingFolderLocation, PRODUCT_NAME, PRODUCT_SETTINGS);
            //dataDir = Path.Combine(roamingFolderLocation, PRODUCT_NAME, PRODUCT_DATA);
            //appTempDir = Path.Combine(roamingFolderLocation, PRODUCT_NAME, PRODUCT_TEMP);

            if (!Directory.Exists(appSettingsDir))
                Directory.CreateDirectory(appSettingsDir);

            //load
            userSettingsFile = appSettingsDir + @"\VaultViewer.properties";
            PropSettings config = new PropSettings(userSettingsFile);
            //get value whith default value
            this.Top = Convert.ToInt32(config.get("MainFormPos_Top", "200"));
            this.Left = Convert.ToInt32(config.get("MainFormPos_Left", "800"));
            this.Height = Convert.ToInt32(config.get("MainFormPos_Height", "450"));
            this.Width = Convert.ToInt32(config.get("MainFormPos_Width", "400"));

            colCategory.Width = Convert.ToInt32(config.get("CategoryColumn_Width", "150"));
            colMetadata.Width = Convert.ToInt32(config.get("CategoryMetadata_Width", "400"));

            string formIsTopmost = config.get("MainFormPos_StayOnTop", "FALSE");
            checkEditStayOnTop.Checked = (formIsTopmost == "TRUE") ? true : false;
            this.TopMost = checkEditStayOnTop.Checked ? true : false;

            docViewerExtList.Add("DOC");
            docViewerExtList.Add("DOCX");
            docViewerExtList.Add("RTF");
            docViewerExtList.Add("HTML");
            docViewerExtList.Add("TXT");

            //PopulateTicketList();
            PopulateTradingSysList();
        }
예제 #5
0
        private void LoadTreeListForTicket(string pTicket)
        {
            //Original stub -- reads sample data from file system directories
            string currentDir = Path.Combine(Properties.Settings.Default.TestRootDir, pTicket);
            string propsFileName = pTicket + "." + PROPS;
            string propsFileAndPath = Path.Combine(currentDir, propsFileName);
            PropSettings configFile = new PropSettings(propsFileAndPath);
            treeListDocs.Nodes.Clear();

            string[] fileEntries = Directory.GetFiles(currentDir);
            foreach (string fileName in fileEntries)
            {
                string fileExt = Path.GetExtension(fileName).Remove(0,1).ToUpper();
                if (fileExt != PROPS.ToUpper())
                {
                    string docCategory = Path.GetFileNameWithoutExtension(fileName);
                    docCategory = docCategory.Substring(0, docCategory.IndexOf("_"));

                    string fileNameWithoutPath = Path.GetFileName(fileName);
                    string docMetaData = configFile.get(fileNameWithoutPath, "[None]");                    
                    treeListDocs.AppendNode(new object[] { docCategory, docMetaData, fileExt, fileName }, -1);
                }
            }

            CloseAllOpenForms();
        }
예제 #6
0
        private void frmVaultViewer_FormClosed(object sender, FormClosedEventArgs e)
        {
            PropSettings config = new PropSettings(userSettingsFile);
            config.set("MainFormPos_Top", this.Top.ToString());
            config.set("MainFormPos_Left", this.Left.ToString());
            config.set("MainFormPos_Height", this.Height.ToString());
            config.set("MainFormPos_Width", this.Width.ToString());
            config.set("CategoryColumn_Width", colCategory.Width.ToString());
            config.set("CategoryMetadata_Width", colMetadata.Width.ToString());

            string formIsTopmost = (checkEditStayOnTop.Checked == true) ? "TRUE" : "FALSE";
            config.set("MainFormPos_StayOnTop", formIsTopmost);

            config.Save();

            Process pro = (Process.GetCurrentProcess());
            pro.Kill();
        }