Beispiel #1
0
        void UpdateSelector(WindowTitleBuilder builder)
        {
            string selectorInfo;
            string error;

            int cmdres = CmdRunner.ExecuteCommandWithResult(
                string.Format("{0} wi --machinereadable --fieldseparator={1}",
                              DEFAULT_PLASTIC_COMMAND, FIELD_SEPARATOR),
                mWkPath, out selectorInfo, out error, false);

            if (cmdres != 0 || !string.IsNullOrEmpty(error))
            {
                return;
            }

            string[] chunks = selectorInfo.Trim().Split(
                new string[] { FIELD_SEPARATOR }, StringSplitOptions.RemoveEmptyEntries);

            if (chunks.Length != 3)
            {
                builder.SetSelector(string.Empty);
                return;
            }

            string selector = string.Format("{0}:{1}@{2}",
                                            chunks[0].ToLower(), chunks[1], chunks[2]);

            builder.SetSelector(selector);
        }
        protected override void Initialize()
        {
            base.Initialize();

            ActivityLog.Initialize(GetService(typeof(SVsActivityLog)) as IVsActivityLog);

            mWindowTitleBuilder = new WindowTitleBuilder();
            mSelectorWatcher = new SelectorWatcher(mWindowTitleBuilder);
            mTitleUpdater = new WindowTitleUpdater(mWindowTitleBuilder);

            DTEService.Get().Events.SolutionEvents.AfterClosing += SolutionClosed;
            DTEService.Get().Events.SolutionEvents.Opened += SolutionOpened;

            mTitleUpdater.Start();
        }
        protected override void Initialize()
        {
            base.Initialize();

            ActivityLog.Initialize(GetService(typeof(SVsActivityLog)) as IVsActivityLog);

            mWindowTitleBuilder = new WindowTitleBuilder();
            mSelectorWatcher    = new SelectorWatcher(mWindowTitleBuilder);
            mTitleUpdater       = new WindowTitleUpdater(mWindowTitleBuilder);

            DTEService.Get().Events.SolutionEvents.AfterClosing += SolutionClosed;
            DTEService.Get().Events.SolutionEvents.Opened += SolutionOpened;

            mTitleUpdater.Start();
        }
 internal WindowTitleUpdater(WindowTitleBuilder titleBuilder)
 {
     mTitleBuilder = titleBuilder;
 }
 internal WindowTitleUpdater(WindowTitleBuilder titleBuilder)
 {
     mTitleBuilder = titleBuilder;
 }
Beispiel #6
0
 internal SelectorWatcher(WindowTitleBuilder builder)
 {
     mBuilder = builder;
 }
        void UpdateSelector(WindowTitleBuilder builder)
        {
            string selectorInfo;
            string error;

            int cmdres = CmdRunner.ExecuteCommandWithResult(
                string.Format("{0} wi --machinereadable --fieldseparator={1}",
                DEFAULT_PLASTIC_COMMAND, FIELD_SEPARATOR), 
                mWkPath, out selectorInfo, out error, false);

            if (cmdres != 0 || !string.IsNullOrEmpty(error))
                return;

            string[] chunks = selectorInfo.Trim().Split(
                new string[] {FIELD_SEPARATOR}, StringSplitOptions.RemoveEmptyEntries);

            if(chunks.Length != 3)
            {
                builder.SetSelector(string.Empty);
                return;
            }

            string selector = string.Format("{0}:{1}@{2}",
                chunks[0].ToLower(), chunks[1], chunks[2]);

            builder.SetSelector(selector);
        }
 internal SelectorWatcher(WindowTitleBuilder builder)
 {
     mBuilder = builder;
 }