Ejemplo n.º 1
0
        private void VSFrmXML_Load(object sender, EventArgs e)
        {
            string ks = VSLib.VSGetKey(DEFS.KEY_STORAGE_ROOT);

            if (ks != "")
            {
                if (MessageBox.Show(ks, "Do you want to open the last used storage?", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    ACTION_OpenStorage(ks);
                }
            }

            this.SHOW_Buttons();
        }
Ejemplo n.º 2
0
        private void VSFrmAdm_Load(object sender, EventArgs e)
        {
            mgr = null;
            string ks = VSLib.VSGetKey(DEFS.KEY_STORAGE_ROOT);

            if (ks != "")
            {
                if (MessageBox.Show(ks, "Do you want to open the last used storage?", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    OpenRoot(ks);
                }
            }

            ShowButtons();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Get path
        /// </summary>
        /// <param name="key"></param>
        /// <param name="title"></param>
        /// <returns></returns>
        public static string SelectPath(string key, string title)
        {
            FolderBrowserDialog d = new FolderBrowserDialog();

            d.SelectedPath = VSLib.VSGetKey(key);

            d.Description = title + ((d.SelectedPath == "") ? "" : " (default: '" + d.SelectedPath + "')");

            DialogResult result = d.ShowDialog();

            if ((result != DialogResult.Cancel) & (d.SelectedPath != ""))
            {
                VSLib.VSSetKey(key, d.SelectedPath);
                return(d.SelectedPath);
            }
            else
            {
                return("");
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Get file
        /// </summary>
        /// <param name="key"></param>
        /// <param name="title"></param>
        /// <returns></returns>
        public static string SelectFile(string key, string title, string filter)
        {
            OpenFileDialog d = new OpenFileDialog();

            d.Filter = filter;

            d.Title = "Select file";

            d.InitialDirectory = VSLib.VSGetKey(key);

            DialogResult result = d.ShowDialog();

            if ((result != DialogResult.Cancel) & (d.FileName != ""))
            {
                //File.WriteAllText(key, Path.GetDirectoryName(d.FileName));
                VSLib.VSSetKey(key, Path.GetDirectoryName(d.FileName));
                return(d.FileName);
            }
            else
            {
                return("");
            }
        }