예제 #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
        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);
        }