Пример #1
0
        /// <summary>
        /// Process for specified event.
        /// </summary>
        /// <param name="evt">Configured event.</param>
        /// <returns>Result of handling.</returns>
        public override bool process(ISolutionEvent evt)
        {
            IModeOperation operation = (IModeOperation)evt.Mode;

            if (operation.Command == null || operation.Command.Length < 1)
            {
                return(true);
            }
            DTEOperation dteo = new DTEOperation(cmd.Env, cmd.EventType);

            if (!evt.SupportMSBuild && !evt.SupportSBEScripts)
            {
                dteo.exec(operation.Command, operation.AbortOnFirstError);
                return(true);
            }

            // need evaluation for data

            ECommand[] parsed = new ECommand[operation.Command.Length];
            for (int i = 0; i < operation.Command.Length; ++i)
            {
                parsed[i].name = parse(evt, operation.Command[i].name);
                parsed[i].args = parse(evt, operation.Command[i].args);
            }

            dteo.exec(parsed, operation.AbortOnFirstError);
            return(true);
        }
Пример #2
0
        public void dtePreparedTest3()
        {
            DTEOperation target = new DTEOperation((IEnvironment)null, SolutionEventType.General);

            string line = "Debug StartWithoutDebugging";
            DTEOperation.DTEPrepared actual = target.parse(line);
        }
Пример #3
0
        public DTECheckFrm(IEnvironment env)
        {
            _dteo = new DTEOperation(env, vsCE.Events.SolutionEventType.General);

            InitializeComponent();
            Icon = Resource.Package_32;
        }
Пример #4
0
        /// <summary>
        /// Process for specified event.
        /// </summary>
        /// <param name="evt">Configured event.</param>
        /// <returns>Result of handling.</returns>
        public override bool process(ISolutionEvent evt)
        {
            IModeOperation operation = (IModeOperation)evt.Mode;
            if(operation.Command == null || operation.Command.Length < 1) {
                return true;
            }
            DTEOperation dteo = new DTEOperation(cmd.Env, cmd.EventType);

            if(!evt.SupportMSBuild && !evt.SupportSBEScripts) {
                dteo.exec(operation.Command, operation.AbortOnFirstError);
                return true;
            }

            // need evaluation for data

            ECommand[] parsed = new ECommand[operation.Command.Length];
            for(int i = 0; i < operation.Command.Length; ++i)
            {
                parsed[i].name = parse(evt, operation.Command[i].name);
                parsed[i].args = parse(evt, operation.Command[i].args);
            }

            dteo.exec(parsed, operation.AbortOnFirstError);
            return true;
        }
Пример #5
0
        public void dtePreparedTest2()
        {
            DTEOperation target = new DTEOperation((IEnvironment)null, SolutionEventType.General);

            string line = "Debug.StartWithoutDebugging";
            DTEOperation.DTEPrepared actual = target.parse(line);

            Assert.AreEqual("Debug.StartWithoutDebugging", actual.name);
            Assert.AreEqual("", actual.args);
        }
Пример #6
0
        public void dtePreparedTest()
        {
            DTEOperation target = new DTEOperation((IEnvironment)null, SolutionEventType.General);

            string line = "File.OpenProject(\"c:\\path\\app.sln\")";
            DTEOperation.DTEPrepared actual = target.parse(line);

            Assert.AreEqual("File.OpenProject", actual.name);
            Assert.AreEqual("\"c:\\path\\app.sln\"", actual.args);
        }
Пример #7
0
 /// <param name="env">Used environment</param>
 public DTEComponent(IEnvironment env)
     : base(env)
 {
     dteo = new DTEOperation(env, Events.SolutionEventType.General);
     attachCommandEvents();
 }
Пример #8
0
        public void dtePreparedTest5()
        {
            DTEOperation target = new DTEOperation((IEnvironment)null, SolutionEventType.General);

            string line = "  OpenProject(arg)  ";
            DTEOperation.DTEPrepared actual = target.parse(line);

            Assert.AreEqual("OpenProject", actual.name);
            Assert.AreEqual("arg", actual.args);
        }