Exemple #1
0
        private void OnBtnOpenFolder(object sender, EventArgs e)
        {
            try
            {
                AceDir d = (WinUtil.IsAppX ? AceDir.User : AceDir.App);

                // try
                // {
                //	string strU = AceApplication.GetLanguagesDir(AceDir.User, false);
                //	List<string> l = UrlUtil.GetFilePaths(strU, "*." +
                //		KPTranslation.FileExtension, SearchOption.TopDirectoryOnly);
                //	if(l.Count > 0) d = AceDir.User;
                // }
                // catch(Exception) { }

                string str = AceApplication.GetLanguagesDir(d, false);
                if (!Directory.Exists(str))
                {
                    Directory.CreateDirectory(str);
                }

                WinUtil.OpenUrlDirectly(str);
                this.DialogResult = DialogResult.Cancel;
            }
            catch (Exception ex) { MessageService.ShowWarning(ex); }
        }
Exemple #2
0
        private void OnComponentShow(object sender, EventArgs e)
        {
            ListViewItem lvi = GetSelectedComponent();

            if (lvi == null)
            {
                Debug.Assert(false); return;
            }

            string strPath = (lvi.Tag as string);

            if (string.IsNullOrEmpty(strPath))
            {
                return;
            }

            if (File.Exists(strPath))
            {
                WinUtil.ShowFileInFileManager(strPath, true);
            }
            else
            {
                WinUtil.OpenUrlDirectly(strPath);
            }
        }
Exemple #3
0
        private void OnBtnOpenFolder(object sender, EventArgs e)
        {
            try
            {
                string str = PluginManager.UserDirectory;
                if (string.IsNullOrEmpty(str))
                {
                    Debug.Assert(false); return;
                }

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

                WinUtil.OpenUrlDirectly(str);
            }
            catch (Exception ex) { MessageService.ShowWarning(ex); }
        }
Exemple #4
0
        public bool InitEx()
        {
            try
            {
                string strDir = UrlUtil.GetFileDirectory(WinUtil.GetExecutable(),
                                                         false, true);
                List <string> l = UrlUtil.GetFilePaths(strDir, "*." +
                                                       KPTranslation.FileExtension, SearchOption.TopDirectoryOnly);
                if (l.Count != 0)
                {
                    string str = KPRes.LngInAppDir + MessageService.NewParagraph;

                    const int cMaxFL = 6;
                    for (int i = 0; i < Math.Min(l.Count, cMaxFL); ++i)
                    {
                        if (i == (cMaxFL - 1))
                        {
                            str += "...";
                        }
                        else
                        {
                            str += l[i];
                        }
                        str += MessageService.NewLine;
                    }
                    str += MessageService.NewLine;

                    str += KPRes.LngInAppDirNote + MessageService.NewParagraph;
                    str += KPRes.LngInAppDirQ;

                    if (MessageService.AskYesNo(str, PwDefs.ShortProductName, true,
                                                MessageBoxIcon.Warning))
                    {
                        WinUtil.OpenUrlDirectly(strDir);
                        return(false);
                    }
                }
            }
            catch (Exception) { Debug.Assert(false); }

            return(true);
        }