Exemplo n.º 1
0
        private void OnKeyInputEnd(object sender, KeyInputEventArgs args)
        {
            System.Console.WriteLine("cyc add listener---");

            return;

            IVimBuffer vb = (IVimBuffer)sender;

            if (vb == null)
            {
                return;
            }

            var status = CommandMarginUtil.GetStatus(vb, vb.Mode, forModeSwitch: false);
            int frozen;

            if (_vsStatusbar != null)
            {
                _vsStatusbar.IsFrozen(out frozen);
                if (frozen != 0)
                {
                    _vsStatusbar.FreezeOutput(0);
                }
                _vsStatusbar.SetText(status);
            }
        }
Exemplo n.º 2
0
        public override void StartProgressMessage(string message)
        {
            // stock general animation icon
            object icon = (short)Microsoft.VisualStudio.Shell.Interop.Constants.SBAI_General;

            try
            {
                // Make sure the status bar is not frozen
                int frozen;
                _statusBar.IsFrozen(out frozen);

                if (frozen != 0)
                {
                    _statusBar.FreezeOutput(0);
                }

                _statusBar.SetText(message);

                // start icon animation
                _statusBar.Animation(1, ref icon);
            }
            catch (InvalidOperationException)
            {
            }
        }
Exemplo n.º 3
0
        public static void StartProgressMessage(string message)
        {
            ThreadHelper.JoinableTaskFactory.RunAsync(async() =>
            {
                await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

                // stock general animation icon
                object icon = (short)Constants.SBAI_General;


                // Make sure the status bar is not frozen
                int frozen;
                _statusBar.IsFrozen(out frozen);

                if (frozen != 0)
                {
                    _statusBar.FreezeOutput(0);
                }

                _statusBar.SetText(message);

                // start icon animation
                _statusBar.Animation(1, ref icon);
            });
        }
Exemplo n.º 4
0
        public bool IsFrozen()
        {
            int frozen;

            ErrorHandler.ThrowOnFailure(statusBar.IsFrozen(out frozen));
            return(Convert.ToBoolean(frozen));
        }
        public override void SetText(string text)
        {
            Assert.ArgumentNotNull(text, nameof(text));

            IVsStatusbar statusBar = null;

            ThreadHelper.JoinableTaskFactory.Run(async delegate
            {
                await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
                statusBar = SitecorePackage.Instance.GetService <SVsStatusbar>() as IVsStatusbar;
            });
            if (statusBar == null)
            {
                return;
            }

            int frozen;

            statusBar.IsFrozen(out frozen);

            if (frozen == 0)
            {
                statusBar.SetText(text);
            }
        }
Exemplo n.º 6
0
        private static bool IsStatusBarFrozen(IVsStatusbar statusBar)
        {
            int frozen;

            statusBar.IsFrozen(out frozen);
            return(frozen == 1);
        }
Exemplo n.º 7
0
        private void SetStatusBarText(string text)
        {
            int frozen;

            if (statusBar != null && statusBar.IsFrozen(out frozen) == 0)
            {
                statusBar.SetText(text);
            }
        }
Exemplo n.º 8
0
        public void SetStatusMessage(String message)
        {
            // Make sure the status bar is not frozen
            int frozen;

            StatusBar.IsFrozen(out frozen);

            if (frozen != 0)
            {
                StatusBar.FreezeOutput(0);
            }

            // Set the status bar text and make its display static.
            StatusBar.SetText(message);

            //SetAnimationObject();
            //StatusBar.Animation(1, ref _animationObject);
        }
Exemplo n.º 9
0
        public override void DeployDot()
        {
            try
            {
                int    fFrozen = 1;
                string msg;

                if (m_statusBar != null &&
                    m_statusBar.IsFrozen(out fFrozen) == Utility.COM_HResults.S_OK &&
                    fFrozen != 1 &&
                    m_statusBar.GetText(out msg) == Utility.COM_HResults.S_OK
                    )
                {
                    m_statusBar.SetText(msg + ".");
                }
            }
            catch (InvalidOperationException)
            {
            }
        }
Exemplo n.º 10
0
        public void SetStatus(string format, params object[] args)
        {
            int frozen;

            _statusBar.IsFrozen(out frozen);

            if (frozen == 0)
            {
                _statusBar.SetText(string.Format(format, args));
            }
        }
Exemplo n.º 11
0
        public void SetStatus(string message)
        {
            int          frozen;
            IVsStatusbar statusBar = base.GetService(typeof(SVsStatusbar)) as IVsStatusbar;

            statusBar.IsFrozen(out frozen);
            if (!Convert.ToBoolean(frozen))
            {
                statusBar.SetText(message);
            }
            OutputStringInGeneralPane(message);
        }
Exemplo n.º 12
0
        internal static void ShowStatus(string message)
        {
            if (_statusBar == null)
            {
                return;
            }
            int frozen;

            _statusBar.IsFrozen(out frozen);
            if (frozen == 0)
            {
                _statusBar.SetText(message);
            }
        }
Exemplo n.º 13
0
        private void UpdateProgress(ExportedMutantInfo info, IVsStatusbar statusBar, int killCount)
        {
            // https://msdn.microsoft.com/en-us/library/bb166795.aspx
            // Make sure the status bar is not frozen
            int frozen;

            statusBar.IsFrozen(out frozen);

            if (frozen != 0)
            {
                statusBar.FreezeOutput(0);
            }
            statusBar.SetText("Mutating " + Path.GetFileName(info.fileName) + " (" + killCount + " mutants killed) ...");
        }
        private void Log(string logText)
        {
            // Make sure the status bar is not frozen
            int frozen;

            _statusBar.IsFrozen(out frozen);
            if (frozen != 0)
            {
                _statusBar.FreezeOutput(0);
            }
            // Set the status bar text and make its display static.
            _statusBar.SetText(logText);
            // Freeze the status bar.
            _statusBar.FreezeOutput(1);
        }
Exemplo n.º 15
0
        public void setStatusBar(string statusMessage)
        {
            IVsStatusbar statusBar = (IVsStatusbar)serviceProvider.GetService(typeof(SVsStatusbar));

            // Check if status bar is frozen and unfreeze it if so
            int frozen;

            statusBar.IsFrozen(out frozen);
            if (frozen != 0)
            {
                statusBar.FreezeOutput(0);
            }

            // Set the status bar text
            statusBar.SetText(DateTime.Now + " - " + statusMessage);
        }
 /// <summary>
 /// Display text on the Visual Studio status bar.
 /// </summary>
 /// <param name="text"></param>
 private void DisplayTextOnStatusBar(string text)
 {
     if (statusBar != null)
     {
         statusBar.IsFrozen(out frozen);
         if (frozen == 0)
         {
             // Set the status bar text and make its display static.
             statusBar.SetText(text);
             statusBar.FreezeOutput(1);
             // Clear the status bar text.
             statusBar.FreezeOutput(0);
             statusBar.Clear();
         }
     }
 }
Exemplo n.º 17
0
        public void WriteToStatusBar(string s)
        {
            if (null == _statusbar)
            {
                return;
            }

            int frozen;

            _statusbar.IsFrozen(out frozen);

            if (0 == frozen)
            {
                _statusbar.SetText(s);
            }
        }
Exemplo n.º 18
0
        public void ShowText(string text)
        {
            Microsoft.VisualStudio.Shell.ThreadHelper.ThrowIfNotOnUIThread();
            if (string.IsNullOrEmpty(text))
            {
                return;
            }

            int frozen;

            _statusBar.IsFrozen(out frozen);
            if (frozen == 0)
            {
                _statusBar.SetText(text);
            }
        }
Exemplo n.º 19
0
        private void SetVsStatusbarText(string text)
        {
            ThreadHelper.ThrowIfNotOnUIThread();
            IVsStatusbar statusBar = (IVsStatusbar)ServiceProvider.GetService(typeof(SVsStatusbar));

            Assumes.Present(statusBar);
            int frozen;

            statusBar.IsFrozen(out frozen);
            if (frozen != 0)
            {
                statusBar.FreezeOutput(0);
            }

            statusBar.SetText(text);
            statusBar.FreezeOutput(1);
        }
Exemplo n.º 20
0
        private void statusBarRefreshTimer_Tick(object sender, object e)
        {
            ThreadHelper.ThrowIfNotOnUIThread();

            int frozen;

            statusBar.IsFrozen(out frozen);

            if (frozen != 0)
            {
                statusBar.FreezeOutput(0);
            }

            statusBar.SetText(text);

            statusBar.FreezeOutput(1);
        }
Exemplo n.º 21
0
        private void PrepareStatusbar(out uint cookie, out object icon)
        {
            cookie = 0;
            icon   = (short)InteropConstants.SBAI_Save;

            int frozen;

            statusBar.IsFrozen(out frozen);

            if (frozen != 0)
            {
                return;
            }

            statusBar.Progress(ref cookie, 1, string.Empty, 0, 0);
            statusBar.SetText("Rendering template...");
            statusBar.Animation(1, ref icon);
        }
Exemplo n.º 22
0
        private void SetText(Levels level, string text)
        {
            if (level != Levels.Info)
            {
                text = FormatLevel(level) + text;
            }

            int frozen;

            _statusBar.IsFrozen(out frozen);

            if (frozen != 0)
            {
                return;
            }

            _statusBar.SetText(text);
        }
Exemplo n.º 23
0
        void WriteStatusBarText(string text)
        {
            IVsStatusbar statusBar = (IVsStatusbar)_serviceProvider.GetService(typeof(SVsStatusbar));

            if (statusBar == null)
            {
                return;
            }

            int frozen;

            statusBar.IsFrozen(out frozen);
            if (frozen != 0)
            {
                statusBar.FreezeOutput(0);
            }

            statusBar.SetText(text);
            statusBar.FreezeOutput(1);
        }
Exemplo n.º 24
0
        private void SetStatusBarText(string status)
        {
            if (!String.IsNullOrEmpty(status))
            {
                status = String.Format("SSMScripter: {0}", status);
            }

            IVsStatusbar statusBar = (IVsStatusbar)ServiceProvider.GetService(typeof(SVsStatusbar));

            int frozen;

            statusBar.IsFrozen(out frozen);

            if (frozen != 0)
            {
                statusBar.FreezeOutput(0);
            }

            statusBar.SetText(status);
        }
Exemplo n.º 25
0
        public void WriteStatus(string message)
        {
            // Make sure the status bar is not frozen
            int frozen;

            _statusBar.IsFrozen(out frozen);
            if (frozen != 0)
            {
                _statusBar.FreezeOutput(0);
            }

            // Set the status bar text and make its display static.
            _statusBar.SetText(message);

            // Freeze the status bar.
            _statusBar.FreezeOutput(1);

            // Clear the status bar text.
            _statusBar.FreezeOutput(0);
            _statusBar.Clear();
        }
Exemplo n.º 26
0
        private void PrepareStatusbar(out object icon)
        {
            icon = (short)InteropConstants.SBAI_Save;

            try
            {
                int frozen;
                _statusBar.IsFrozen(out frozen);

                if (frozen != 0)
                {
                    return;
                }

                _statusBar.SetText("Rendering template...");
                _statusBar.Animation(1, ref icon);
            }
            catch (Exception exception)
            {
                Log.Debug("Failed to prepare statusbar: {0}", exception.Message);
            }
        }
            public override async Task ReportProgressAsync(
                string progressMessage,
                uint currentStep,
                uint totalSteps)
            {
                await _taskFactory.SwitchToMainThreadAsync();

                // Make sure the status bar is not frozen
                int frozen;

                _statusBar.IsFrozen(out frozen);

                if (frozen != 0)
                {
                    _statusBar.FreezeOutput(0);
                }

                _statusBar.SetText(progressMessage);

                if (totalSteps != 0)
                {
                    _statusBar.Progress(ref _cookie, 1, "", currentStep, totalSteps);
                }
            }
Exemplo n.º 28
0
        private void PrepareStatusbar(out uint cookie, out object icon)
        {
            cookie = 0;
            icon   = (short)InteropConstants.SBAI_Save;

            try
            {
                int frozen;
                statusBar.IsFrozen(out frozen);

                if (frozen != 0)
                {
                    return;
                }

                statusBar.Progress(ref cookie, 1, string.Empty, 0, 0);
                statusBar.SetText("Rendering template...");
                statusBar.Animation(1, ref icon);
            }
            catch (Exception exception)
            {
                Log.Debug("Failed to prepare statusbar: {0}", exception.Message);
            }
        }
Exemplo n.º 29
0
        /// <summary>
        /// Get all library archives accessible to the linker of the specified project.
        /// </summary>
        /// <param name="project">The project to get the LibArchives for</param>
        /// <param name="statusBar">the VS status bar</param>
        /// <returns>Parsed libraries which are accessible by the linker of the given project.</returns>
        public List<LibArchive> GetLibraryArchives(Project project, IVsStatusbar statusBar)
        {
            int frozen;
            uint cookie = 0;
            statusBar.IsFrozen(out frozen);

            if (!_projectArchiveMap.ContainsKey(project))
            {
                var archives = new List<LibArchive>();
                var libraries = GetLibraries(project);

                if (frozen == 0)
                    statusBar.Progress(ref cookie, 1, "", 0, (uint)libraries.Count);

                int i = 0;
                foreach(var lib in libraries)
                {
                    if (frozen == 0)
                    {
                        statusBar.Progress(ref cookie, 1, "", (uint) i++, (uint)libraries.Count);
                        statusBar.SetText("Scanning " + Path.GetFileName(lib));
                    }

                    archives.Add(GetArchive(lib));
                }
                _projectArchiveMap.Add(project, archives);
            }

            if (frozen == 0)
            {
                statusBar.Progress(ref cookie, 0, "", 0, 0);
                statusBar.Clear();
            }

            return _projectArchiveMap[project];
        }
Exemplo n.º 30
0
            public override void ReportProgress(
                string progressMessage,
                uint currentStep,
                uint totalSteps)
            {
                ThreadHelper.ThrowIfNotOnUIThread();

                // Make sure the status bar is not frozen
                int frozen;

                StatusBar.IsFrozen(out frozen);

                if (frozen != 0)
                {
                    StatusBar.FreezeOutput(0);
                }

                StatusBar.SetText(progressMessage);

                if (totalSteps != 0)
                {
                    StatusBar.Progress(ref cookie, 1, "", currentStep, totalSteps);
                }
            }
Exemplo n.º 31
0
        //<Snippet1>
        void FeedbackRegionExample()
        {
            IVsStatusbar statusBar =
                (IVsStatusbar)GetService(typeof(SVsStatusbar));
            int frozen;

            statusBar.IsFrozen(out frozen);

            if (frozen == 0)
            {
                // Set the status bar text and make its display static.
                statusBar.SetText("Here's some static text.");
                statusBar.FreezeOutput(1);

                // Retrieve the status bar text.
                string text;
                statusBar.GetText(out text);
                System.Windows.Forms.MessageBox.Show(text);

                // Clear the status bar text.
                statusBar.FreezeOutput(0);
                statusBar.Clear();
            }
        }
Exemplo n.º 32
0
 private static bool IsStatusBarFrozen(IVsStatusbar statusBar) {
     int frozen;
     statusBar.IsFrozen(out frozen);
     return frozen == 1;
 }