コード例 #1
0
ファイル: PluginMain.cs プロジェクト: Nindzzya/thecodingfrog
        /// <summary>
        /// Handles the incoming events
        /// </summary>
        public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority prority)
        {
            switch (e.Type)
            {
            // Catches Project change event and display the active project path
            case EventType.Command:
                string cmd = (e as DataEvent).Action;
                //MessageBox.Show(cmd);
                switch (cmd)
                {
                case "ProjectManager.Project":
                    IProject project = PluginBase.CurrentProject;
                    if (project == null)
                    {
                        //
                    }
                    else
                    {
                        CheckProject();
                    }
                    break;

                case "ProjectManager.BuildingProject":
                    __lastAction = CompilationModes.BuildProject;
                    break;

                case "ProjectManager.TestingProject":
                    __lastAction = CompilationModes.TestMovie;
                    break;

                case "ProjectManager.BuildFailed":
                    //MessageBox.Show("ProjectManager.BuildFailed");
                    break;
                }

                break;

            case EventType.ProcessStart:
                //MessageBox.Show("EventType.ProcessStart");
                if (settingObject.AutoIncrement &&
                    __isVersionned &&
                    (settingObject.CompilationMode == CompilationModes.Both ||
                     (settingObject.CompilationMode == CompilationModes.BuildProject && __lastAction == CompilationModes.BuildProject) ||
                     (settingObject.CompilationMode == CompilationModes.TestMovie && __lastAction == CompilationModes.TestMovie)
                    )
                    )
                {
                    IncrementVersion();
                }
                break;

            case EventType.ProcessEnd:
                //MessageBox.Show("EventType.ProcessEnd");
                string res = (e as TextEvent).Value;
                //MessageBox.Show(hasNoCompilationError(res).ToString());
                //MessageBox.Show(__lastAction.ToString());
                if (!hasNoCompilationError(res) &&
                    __isVersionned &&
                    settingObject.AutoIncrement &&
                    (settingObject.CompilationMode == CompilationModes.Both ||
                     (settingObject.CompilationMode == CompilationModes.BuildProject && __lastAction == CompilationModes.BuildProject) ||
                     (settingObject.CompilationMode == CompilationModes.TestMovie && __lastAction == CompilationModes.TestMovie)
                    )
                    )
                {
                    DecrementVersion();
                }
                break;
            }
        }
コード例 #2
0
        /// <summary>
        /// Handles the incoming events
        /// </summary>
        public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority prority)
        {
            switch (e.Type)
            {
                // Catches Project change event and display the active project path
                case EventType.Command:
                    string cmd = (e as DataEvent).Action;
                    //MessageBox.Show(cmd);
                    switch (cmd)
                    {
                        case "ProjectManager.Project":
                            IProject project = PluginBase.CurrentProject;
                            if (project == null)
                            {
                                //
                            }
                            else
                            {
                                CheckProject();
                            }
                            break;

                        case "ProjectManager.BuildingProject":
                            __lastAction = CompilationModes.BuildProject;
                            break;

                        case "ProjectManager.TestingProject":
                            __lastAction = CompilationModes.TestMovie;
                            break;

                        case "ProjectManager.BuildFailed":
                            //MessageBox.Show("ProjectManager.BuildFailed");
                            break;
                    }

                    break;
                case EventType.ProcessStart:
                    //MessageBox.Show("EventType.ProcessStart");
                    if (settingObject.AutoIncrement
                            && __isVersionned
                            && (settingObject.CompilationMode == CompilationModes.Both
                                || (settingObject.CompilationMode == CompilationModes.BuildProject && __lastAction == CompilationModes.BuildProject)
                                || (settingObject.CompilationMode == CompilationModes.TestMovie && __lastAction == CompilationModes.TestMovie)
                            )
                        )
                        IncrementVersion();
                    break;
                case EventType.ProcessEnd:
                    //MessageBox.Show("EventType.ProcessEnd");
                    string res = (e as TextEvent).Value;
                    //MessageBox.Show(hasNoCompilationError(res).ToString());
                    //MessageBox.Show(__lastAction.ToString());
                    if (!hasNoCompilationError(res)
                            && __isVersionned
                            && settingObject.AutoIncrement
                            && (settingObject.CompilationMode == CompilationModes.Both
                                || (settingObject.CompilationMode == CompilationModes.BuildProject && __lastAction == CompilationModes.BuildProject)
                                || (settingObject.CompilationMode == CompilationModes.TestMovie && __lastAction == CompilationModes.TestMovie)
                            )
                        )
                    {
                        DecrementVersion();
                    }
                    break;
            }
        }