コード例 #1
0
 public WebApiResult <string> Any(OpenFolderRequest request)
 {
     try
     {
         System.Diagnostics.Process.Start(request.Path);//"ExpLore",
         return(new WebApiResult <string>()
         {
             success = 1
         });
     }
     catch (Exception ex)
     {
         return(new WebApiResult <string>()
         {
             success = 0, msg = "错误: " + ex.ToString()
         });
     }
 }
コード例 #2
0
        /// <summary>
        /// プロジェクトを開く
        /// </summary>
        void RaiseOpenFolderCommand()
        {
            var notification = new FolderSelectDialogConfirmation()
            {
                InitialDirectory    = this.BaseFolderPath.Value,
                SelectedPath        = this.BaseFolderPath.Value,
                RootFolder          = Environment.SpecialFolder.Personal,
                ShowNewFolderButton = false
            };

            OpenFolderRequest.Raise(notification);
            if (notification.Confirmed)
            {
                // SelectedPath の最後のディレクトリ名をプロジェクト名に
                // その前までをベースフォルダに
                int lastPos = notification.SelectedPath.LastIndexOf("\\");
                this.BaseFolderPath.Value = notification.SelectedPath.Substring(0, lastPos + 1);
                this.ProjectName.Value    = notification.SelectedPath.Substring(lastPos + 1);

                FileTree.Clear();
                FileTree.Add(new FileTreeItem(this.ProjectFolderPath.Value));
            }
        }