示例#1
0
 protected override void OnHandleMessageRecived(object sender, MessageArgs args)
 {
     if (args.Message == null || Services.ProjectsService == null || Services.ProjectsService.CurrentSolution == null || !args.Message.Data.Equals((string)Services.ProjectsService.CurrentSolution.FileName))
     {
         return;
     }
     MutualCore.ShowCurrApplication();
 }
示例#2
0
 protected StartInfoService()
 {
     MutualCore.Init();
     this.argsProjFilePath = this.argsSlnFilePath = string.Empty;
 }
示例#3
0
        public void HandleMacStartOpen(string projOrSlnPath)
        {
            if (!Platform.IsMac)
            {
                return;
            }
            string str1 = this.PreCheckFilePathLegal(projOrSlnPath);

            if (string.IsNullOrEmpty(str1))
            {
                projOrSlnPath = Path.Combine(projOrSlnPath);
                string csdFilePath = projOrSlnPath;
                string str2        = projOrSlnPath;
                bool   flag1       = Path.GetExtension(projOrSlnPath).ToLower() == ".csd";
                if (flag1)
                {
                    str2 = this.GetCCSFilePath(csdFilePath);
                }
                bool flag2 = Services.ProjectsService.CurrentSolution == null;
                if (!flag2 && Services.ProjectsService.CurrentSolution.FileName == (FilePath)str2)
                {
                    MutualCore.ShowCurrApplication();
                    return;
                }
                if (SolutionLockHandler.Instance.IsSolutionLocked(str2))
                {
                    MutualCore.Instance.SendMessage(str2, Action.Show);
                    str1 = LanguageInfo.OpenSameProject;
                }
                else if (flag2)
                {
                    Services.Workspace.OpenWorkspaceItem(str2);
                    if (flag1)
                    {
                        StartRecoverService.ProjectFilePathByDoubleClick = csdFilePath;
                    }
                }
                else
                {
                    try
                    {
                        System.Diagnostics.Process process = new System.Diagnostics.Process();
                        process.EnableRaisingEvents = false;
                        ProcessStartInfo processStartInfo = new ProcessStartInfo();
                        processStartInfo.Arguments = projOrSlnPath;
                        string str3 = Path.Combine(Option.AssemblyPath, "CocosStudio");
                        processStartInfo.FileName = str3;
                        process.StartInfo         = processStartInfo;
                        if (!process.Start())
                        {
                            str1 = LanguageInfo.OpenProjectFail;
                        }
                    }
                    catch (Exception ex)
                    {
                        str1 = LanguageInfo.OpenProjectFail + ex.ToString();
                    }
                }
            }
            if (string.IsNullOrEmpty(str1))
            {
                return;
            }
            LogConfig.Output.Error((object)str1);
        }