Esempio n. 1
0
        protected void ValidateControl(object sender, CancelEventArgs e)
        {
            try
            {
                ValidateProperties();
            }
            catch (PropertyPageArgumentException ex)
            {
                IServiceProvider serviceProvider = ParentPropertyPage.Site;
                string           message         = ex.Message;
                string           title           = "Dart Project Error";
                OLEMSGICON       icon            = OLEMSGICON.OLEMSGICON_CRITICAL;
                OLEMSGBUTTON     button          = OLEMSGBUTTON.OLEMSGBUTTON_OK;
                OLEMSGDEFBUTTON  defaultButton   = OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST;
                if (serviceProvider != null)
                {
                    VsShellUtilities.ShowMessageBox(serviceProvider, message, title, icon, button, defaultButton);
                }

                e.Cancel = true;
            }
        }
Esempio n. 2
0
        protected virtual void HandleTextBufferChangedLowPriority(object sender, TextContentChangedEventArgs e)
        {
            if (_failedTimeout)
            {
                if (!_timeoutReported)
                {
                    IServiceProvider serviceProvider = null;
                    string           message         = null;
                    string           title           = null;
                    OLEMSGICON       icon            = OLEMSGICON.OLEMSGICON_CRITICAL;
                    OLEMSGBUTTON     button          = OLEMSGBUTTON.OLEMSGBUTTON_OK;
                    OLEMSGDEFBUTTON  defaultButton   = OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST;
                    if (serviceProvider != null)
                    {
                        _timeoutReported = true;
                        VsShellUtilities.ShowMessageBox(serviceProvider, message, title, icon, button, defaultButton);
                    }
                }

                return;
            }

            if (e.After == _textBuffer.CurrentSnapshot)
            {
                ClassifierState classifierState = _lineStatesCache.GetValue(e.After, CreateClassifierState);
                if (classifierState._firstChangedLine.HasValue && classifierState._lastChangedLine.HasValue)
                {
                    int startLine = classifierState._firstChangedLine.Value;
                    int endLine   = Math.Min(classifierState._lastChangedLine.Value, e.After.LineCount - 1);

                    classifierState._firstChangedLine = null;
                    classifierState._lastChangedLine  = null;

                    ForceReclassifyLines(classifierState, startLine, endLine);
                }
            }
        }