private static void AboutCmd_Execute(object sender, CommandRunArgs e)
        {
            HelpDialog helpDialog = new HelpDialog();

            helpDialog.Run();
            helpDialog.Destroy();
        }
 private static void HelpCmd_Execute(object sender, CommandRunArgs e)
 {
     try
     {
         Process.Start(new Uri(LanguageOption.CurrentLanguage != LanguageType.Chinese ? "http://cocostudio.org/help/2.0/english" : "http://cocostudio.org/help/2.0/chinese", UriKind.RelativeOrAbsolute).ToString());
     }
     catch (Exception ex)
     {
     }
 }
        private static void RecentFileCmd_Execute(object sender, CommandRunArgs args)
        {
            ProjectItemModel dataItem = args.DataItem as ProjectItemModel;

            if (!File.Exists(dataItem.LocalPath))
            {
                MessageBox.Show("该项目不存在", (Window)null, (string)null, MessageBoxImage.Info);
                Services.RecentFileService.ReloadRecentFiles();
            }
            else
            {
                GlobalCommand.OpenCmd.RaiseExecute((object)dataItem.LocalPath);
            }
        }
        private static void PadCmd_Execute(object sender, CommandRunArgs args)
        {
            Pad      dataItem = args.DataItem as Pad;
            PadCodon content  = dataItem.Content as PadCodon;

            if (!dataItem.Visible)
            {
                Services.MainWindow.ShowPad(content);
                Services.MainWindow.BringToFront(content);
                dataItem.AutoHide = false;
            }
            else
            {
                Services.MainWindow.HidePad(content);
            }
        }
        private static void SaveAsCmd_Execute(object sender, CommandRunArgs e)
        {
            Services.Workbench.SaveAll();
            Solution selectedSolution = Services.ProjectOperations.CurrentSelectedSolution;
            FilePath itemDirectory    = selectedSolution.ItemDirectory;
            FilePath fileName         = (FilePath)FileChooserDialogModel.GetSaveFilesPath(new string[1] {
                "*.ccs"
            }, LanguageInfo.Dialog_SaveAs, false, (string)selectedSolution.FileName).FileName;
            FilePath filePath = fileName.ParentDirectory.Combine(new string[1]
            {
                fileName.FileNameWithoutExtension
            });

            if (Directory.Exists((string)filePath))
            {
                MessageBox.Show(string.Format(LanguageInfo.MessageBox_Content172, (object)fileName.FileNameWithoutExtension), (Window)null, (string)null, MessageBoxImage.Info);
            }
            else
            {
                try
                {
                    Directory.CreateDirectory((string)filePath);
                    FileService.CopyDirectory((string)selectedSolution.BaseDirectory, (string)filePath);
                    if (selectedSolution.Name != fileName.FileNameWithoutExtension)
                    {
                        string oldName = (string)filePath.Combine(new string[1]
                        {
                            selectedSolution.FileName.FileName
                        });
                        string newName = (string)filePath.Combine(new string[1]
                        {
                            fileName.FileName
                        });
                        FileService.RenameFile(oldName, newName);
                        Services.ProjectsService.ChangeSolutionName(Services.ProgressMonitors.Default, (FilePath)newName, selectedSolution.FileName.FileNameWithoutExtension, fileName.FileNameWithoutExtension);
                    }
                    LogConfig.Output.Error((object)LanguageInfo.Output_SaveAsSucceed);
                }
                catch (Exception ex)
                {
                    LogConfig.Output.Error((object)LanguageInfo.Output_FailedToSaveFile, ex);
                }
            }
        }
 private static void OpenDirCmd_Execute(object sender, CommandRunArgs e)
 {
     try
     {
         string fullPath = Services.Workbench.ActiveDocument.Project.FullPath;
         if (Platform.IsWindows)
         {
             Process.Start("Explorer", "/select," + fullPath);
         }
         else
         {
             Process.Start("open", "-R " + string.Format("\"{0}\"", (object)fullPath));
         }
     }
     catch
     {
         LogConfig.Output.Error((object)LanguageInfo.Output_FailedToOpenDir);
     }
 }
        private static void StartLauncherCmd_Execute(object sender, CommandRunArgs e)
        {
            string fileName = string.Empty;

            if (Platform.IsWindows)
            {
                fileName = Path.Combine(Option.AssemblyPath, "Cocos.exe");
            }
            else if (Platform.IsMac)
            {
                fileName = "/Applications/Cocos/Cocos.app/Contents/MacOS/Cocos";
            }
            try
            {
                Process.Start(new ProcessStartInfo(fileName, "-page*2"));
            }
            catch (Exception ex)
            {
                LogConfig.Logger.Error((object)(LanguageInfo.MessageBox226_LauncherStartFailed + "\r\n" + ex.ToString()));
                MessageBox.Show(LanguageInfo.MessageBox226_LauncherStartFailed, (Window)null, (string)null, MessageBoxImage.Info);
            }
        }
示例#8
0
 private static void EmptyRootCmd_Execute(object sender, CommandRunArgs e)
 {
 }
 private static void CloseOtherCmd_Execute(object sender, CommandRunArgs e)
 {
     Services.Workbench.CloseAll(true);
 }
 private static void CloseProjectCmd_Execute(object sender, CommandRunArgs e)
 {
     Services.ProjectOperations.CloseSolution();
 }
 private static void SetSpanishCmd_Execute(object sender, CommandRunArgs e)
 {
     LanguageOption.SetDefaultLanguageConfig(LanguageType.Spanish);
     GlobalCommandHandle.showOkInfoDialog("Configuración de lenguaje correcta,el reinicio de editor es válido!", "Recordatorio", "Aceptar");
 }
 private static void SaveCmd_Execute(object sender, CommandRunArgs e)
 {
     Services.Workbench.ActiveDocument.Save();
 }
 private static void SetJapaneseCmd_Execute(object sender, CommandRunArgs e)
 {
     LanguageOption.SetDefaultLanguageConfig(LanguageType.Japanese);
     GlobalCommandHandle.showOkInfoDialog("言語を設定しました。エディターを再起動してください。", "ヒント", "確認");
 }
 private static void SetKoreanCmd_Execute(object sender, CommandRunArgs e)
 {
     LanguageOption.SetDefaultLanguageConfig(LanguageType.Korean);
     GlobalCommandHandle.showOkInfoDialog("언어 설정 성공, 에디터를 재가동하면 적용됩니다!", "알림", "확인");
 }
 private static void SetChineseCmd_Execute(object sender, CommandRunArgs e)
 {
     LanguageOption.SetDefaultLanguageConfig(LanguageType.Chinese);
     GlobalCommandHandle.showOkInfoDialog("语言设置成功,重启编辑器生效!", "提示", "确定");
 }
 private static void SetEnglishCmd_Execute(object sender, CommandRunArgs e)
 {
     LanguageOption.SetDefaultLanguageConfig(LanguageType.English);
     GlobalCommandHandle.showOkInfoDialog("Set successfully! Please restart Editor now!", "Prompt", "OK");
 }
 private static void SaveAllCmd_Execute(object sender, CommandRunArgs e)
 {
     Services.Workspace.Save(Services.ProgressMonitors.GetConsoleProgressMonitor(false));
 }
 private static void CloseCmd_Execute(object sender, CommandRunArgs e)
 {
     Services.Workbench.ActiveDocument.Close(false);
 }
 private static void QuitCmd_Execute(object sender, CommandRunArgs e)
 {
     Services.MainWindow.Quit();
 }
 private static void ResetLayoutCmd_Execute(object sender, CommandRunArgs e)
 {
     Services.MainWindow.ResetDefaultLayout();
 }
 private static void RedoCmd_Execute(object sender, CommandRunArgs e)
 {
     int num = (int)GlobalCommandHandle.taskService.Redo((object)Services.Workbench.ActiveDocument);
 }