public static string GetTaskTokenList(IVsCommentTaskInfo tokenInfo)
        {
            int tokenCount;
            if (Succeeded(tokenInfo.TokenCount(out tokenCount)) && tokenCount > 0)
            {
                var tokens = new IVsCommentTaskToken[tokenCount];
                var tokensEnum = default(IVsEnumCommentTaskTokens);
                if (Succeeded(tokenInfo.EnumTokens(out tokensEnum)))
                {
                    uint count;
                    if (Succeeded(tokensEnum.Next((uint)tokenCount, tokens, out count)))
                    {
                        Contract.Requires(tokenCount == count);

                        string text;
                        var priority = new VSTASKPRIORITY[1];
                        var result = new List<string>();
                        foreach (var token in tokens)
                        {
                            if (Succeeded(token.Text(out text)) &&
                                Succeeded(token.Priority(priority)) &&
                                !string.IsNullOrWhiteSpace(text))
                            {
                                result.Add(string.Format("{0}:{1}", text, (int)priority[0]));
                            }
                        }

                        return string.Join("|", result);
                    }
                }
            }

            return string.Empty;
        }
예제 #2
0
 public TaskItemInfo(string document, int line, int column, VSTASKPRIORITY priority, VSTASKCATEGORY category, __VSERRORCATEGORY? errorCategory, string message) {
     Document = document;
     Line = line;
     Column = column;
     Priority = priority;
     Category = category;
     ErrorCategory = errorCategory;
     Message = message;
 }
예제 #3
0
        public int put_Priority(VSTASKPRIORITY tpPriority)
        {
            switch (tpPriority)
            {
            case VSTASKPRIORITY.TP_LOW: priority = TaskPriority.Low; break;

            case VSTASKPRIORITY.TP_NORMAL: priority = TaskPriority.Normal; break;

            case VSTASKPRIORITY.TP_HIGH: priority = TaskPriority.High; break;
                // don't do anything in another case
            }
            return(0);
        }
예제 #4
0
 public TaskItem(IServiceProvider site, IVsTextLineMarker textLineMarker, string fileName, string text, bool readOnly, VSTASKCATEGORY cat, VSTASKPRIORITY pri, _vstaskbitmap bitmap, string helpKeyword, Severity severity)
 {
     this.site           = site;
     this.text           = text;
     this.fileName       = fileName;
     this.textLineMarker = textLineMarker;
     this.helpKeyword    = helpKeyword;
     this.category       = cat;
     this.priority       = pri;
     this.bitmap         = bitmap;
     this.readOnly       = readOnly;
     this.severity       = severity;
 }
예제 #5
0
        // called when OnCommentTaskInfoChanged is called.
        public void Refresh()
        {
            //Get token enumerator and allocate memory
            Guid guid = typeof(IVsCommentTaskInfo).GUID;
            IVsCommentTaskInfo commentTaskInfo = null;

            try {
                commentTaskInfo = (IVsCommentTaskInfo)this.site.QueryService(guid, typeof(IVsCommentTaskInfo));
                if (commentTaskInfo == null)
                {
                    return;
                }

                int count;
                commentTaskInfo.TokenCount(out count);

                IVsEnumCommentTaskTokens commentTaskTokens = null;
                commentTaskInfo.EnumTokens(out commentTaskTokens);

                Hashtable newTokens = new Hashtable();

                //Get all tokens

                int index = 0;
                for (index = 0; index < count; index++)
                {
                    uint fetched;
                    IVsCommentTaskToken[] commentTaskToken = new IVsCommentTaskToken[1];

                    commentTaskTokens.Next(1, commentTaskToken, out fetched);
                    if (fetched == 1)
                    {
                        string           token    = null;
                        VSTASKPRIORITY[] priority = new VSTASKPRIORITY[1] {
                            VSTASKPRIORITY.TP_NORMAL
                        };
                        commentTaskToken[0].Text(out token);
                        commentTaskToken[0].Priority(priority);
                        if (token != null)
                        {
                            newTokens[token] = priority[0];
                        }
                    }
                }

                //update the token information
                this.taskTokens = newTokens;
            } catch (Exception) {
                return;
            }
        }
 int IVsLanguageServiceBuildErrorReporter2.ReportError(
     string bstrErrorMessage,
     string bstrErrorId,
     [ComAliasName("VsShell.VSTASKPRIORITY")] VSTASKPRIORITY nPriority,
     int iLine,
     int iColumn,
     string bstrFileName)
 {
     return(_externalErrorReporter.ReportError(
                bstrErrorMessage,
                bstrErrorId,
                nPriority,
                iLine,
                iColumn,
                bstrFileName));
 }
예제 #7
0
 public int ReportError(
     string bstrErrorMessage,
     string bstrErrorId,
     VSTASKPRIORITY nPriority,
     int iLine,
     int iColumn,
     string bstrFileName
     ) =>
 GetExternalErrorReporter()
 .ReportError(
     bstrErrorMessage,
     bstrErrorId,
     nPriority,
     iLine,
     iColumn,
     bstrFileName
     );
예제 #8
0
        internal TaskProviderItem(
            string message,
            SourceSpan rawSpan,
            VSTASKPRIORITY priority,
            bool squiggle,
            ITextSnapshot snapshot
            )
        {
            _message  = message;
            _rawSpan  = rawSpan;
            _snapshot = snapshot;
            _span     = snapshot != null?CreateSpan(snapshot, rawSpan) : null;

            _rawSpan  = rawSpan;
            _priority = priority;
            _squiggle = squiggle;
        }
예제 #9
0
        public void IndentationInconsistencyWarning()
        {
            GetOptions().IndentationInconsistencySeverity = Severity.Warning;
            var project = DebugProject.OpenProject(@"Python.VS.TestData\InconsistentIndentation.sln");
            var app     = new PythonVisualStudioApp(VsIdeTestHostContext.Dte);

            var errorList = (IVsErrorList)VsIdeTestHostContext.ServiceProvider.GetService(typeof(SVsErrorList));

            const int          expectedItems = 1;
            List <IVsTaskItem> allItems      = GetErrorListItems(errorList, expectedItems);

            Assert.AreEqual(expectedItems, allItems.Count);

            VSTASKPRIORITY[] pri = new VSTASKPRIORITY[1];
            ErrorHandler.ThrowOnFailure(allItems[0].get_Priority(pri));
            Assert.AreEqual(VSTASKPRIORITY.TP_NORMAL, pri[0]);
        }
예제 #10
0
        public void IndentationInconsistencyError()
        {
            using (var app = new PythonVisualStudioApp()) {
                var options  = app.Options;
                var severity = options.IndentationInconsistencySeverity;
                options.IndentationInconsistencySeverity = Severity.Error;
                app.OnDispose(() => options.IndentationInconsistencySeverity = severity);

                var project = app.OpenProject(@"TestData\InconsistentIndentation.sln");

                var items = app.WaitForErrorListItems(1);
                Assert.AreEqual(1, items.Count);

                VSTASKPRIORITY[] pri = new VSTASKPRIORITY[1];
                ErrorHandler.ThrowOnFailure(items[0].get_Priority(pri));
                Assert.AreEqual(VSTASKPRIORITY.TP_HIGH, pri[0]);
            }
        }
        private void CacheCommentTokens()
        {
            // The VS options dialog allows tokens to be entered that differ only by case (e.g., todo and TODO),
            // and it allows them to each have a different priority assigned.  However, the VS comment task provider
            // doesn't match case-insensitively, so only the last token and priority are used within a case group.
            // We'll be smarter than that and detect whether case-sensitivity is required for a token.
            Dictionary <string, TaskPriority> tempTokens = new Dictionary <string, TaskPriority>();

            if (this.VsTaskList is IVsCommentTaskInfo tokenInfo &&
                ErrorHandler.Succeeded(tokenInfo.TokenCount(out int tokenCount)) && tokenCount > 0)
            {
                var tokens = new IVsCommentTaskToken[tokenCount];
                if (ErrorHandler.Succeeded(tokenInfo.EnumTokens(out IVsEnumCommentTaskTokens tokenEnum)) &&
                    ErrorHandler.Succeeded(tokenEnum.Next((uint)tokenCount, tokens, out uint count)) && count == tokenCount)
                {
                    var priority = new VSTASKPRIORITY[1];
                    foreach (var token in tokens)
                    {
                        if (ErrorHandler.Succeeded(token.Text(out string text)) &&
                            ErrorHandler.Succeeded(token.Priority(priority)) &&
                            !string.IsNullOrWhiteSpace(text))
                        {
                            tempTokens.Add(text, (TaskPriority)priority[0]);
                        }
                    }
                }
            }

            lock (this.foregroundTokens)
            {
                this.foregroundTokens.Clear();
                var groups = tempTokens.GroupBy(pair => pair.Key, StringComparer.OrdinalIgnoreCase);
                foreach (var group in groups)
                {
                    bool isCaseSensitive = group.Count() > 1;
                    foreach (var pair in group)
                    {
                        this.foregroundTokens.Add(new CommentToken(pair.Key, pair.Value, isCaseSensitive));
                    }
                }

                this.foregroundTokensChanged = true;
            }
        }
예제 #12
0
 internal TaskProviderItem(
     IServiceProvider serviceProvider,
     string message,
     SourceSpan rawSpan,
     VSTASKPRIORITY priority,
     VSTASKCATEGORY category,
     bool squiggle,
     LocationTracker spanTranslator
     )
 {
     _serviceProvider = serviceProvider;
     _message         = message;
     _rawSpan         = rawSpan;
     _spanTranslator  = spanTranslator;
     _rawSpan         = rawSpan;
     _priority        = priority;
     _category        = category;
     _squiggle        = squiggle;
 }
예제 #13
0
        public void IndentationInconsistencyError(PythonVisualStudioApp app)
        {
            //var oldSuppress = VsProjectAnalyzer.SuppressTaskProvider;
            //app.OnDispose(() => VsProjectAnalyzer.SuppressTaskProvider = oldSuppress);
            var options  = app.Options;
            var severity = options.IndentationInconsistencySeverity;

            options.IndentationInconsistencySeverity = Severity.Error;
            app.OnDispose(() => options.IndentationInconsistencySeverity = severity);

            var project = app.OpenProject(@"TestData\InconsistentIndentation.sln");

            var items = app.WaitForErrorListItems(1);

            Assert.AreEqual(1, items.Count);

            VSTASKPRIORITY[] pri = new VSTASKPRIORITY[1];
            ErrorHandler.ThrowOnFailure(items[0].get_Priority(pri));
            Assert.AreEqual(VSTASKPRIORITY.TP_HIGH, pri[0]);
        }
 void IVsLanguageServiceBuildErrorReporter2.ReportError2(
     string bstrErrorMessage,
     string bstrErrorId,
     [ComAliasName("VsShell.VSTASKPRIORITY")] VSTASKPRIORITY nPriority,
     int iStartLine,
     int iStartColumn,
     int iEndLine,
     int iEndColumn,
     string bstrFileName)
 {
     _externalErrorReporter.ReportError2(
         bstrErrorMessage,
         bstrErrorId,
         nPriority,
         iStartLine,
         iStartColumn,
         iEndLine,
         iEndColumn,
         bstrFileName);
 }
예제 #15
0
 public void ReportError2(
     string bstrErrorMessage,
     string bstrErrorId,
     VSTASKPRIORITY nPriority,
     int iStartLine,
     int iStartColumn,
     int iEndLine,
     int iEndColumn,
     string bstrFileName
     ) =>
 GetExternalErrorReporter()
 .ReportError2(
     bstrErrorMessage,
     bstrErrorId,
     nPriority,
     iStartLine,
     iStartColumn,
     iEndLine,
     iEndColumn,
     bstrFileName
     );
예제 #16
0
 public int ReportError(
     string bstrErrorMessage,
     string bstrErrorId,
     [ComAliasName("VsShell.VSTASKPRIORITY")] VSTASKPRIORITY nPriority,
     int iLine,
     int iColumn,
     string bstrFileName
     )
 {
     ReportError2(
         bstrErrorMessage,
         bstrErrorId,
         nPriority,
         iLine,
         iColumn,
         iLine,
         iColumn,
         bstrFileName
         );
     return(VSConstants.S_OK);
 }
예제 #17
0
        internal TaskProviderItem(
            IServiceProvider serviceProvider,
            string message,
            SourceSpan rawSpan,
            VSTASKPRIORITY priority,
            VSTASKCATEGORY category,
            bool squiggle,
            ITextSnapshot snapshot
            )
        {
            _serviceProvider = serviceProvider;
            _message         = message;
            _rawSpan         = rawSpan;
            _snapshot        = snapshot;
            _span            = snapshot != null?CreateSpan(snapshot, rawSpan) : null;

            _rawSpan  = rawSpan;
            _priority = priority;
            _category = category;
            _squiggle = squiggle;
        }
        int IVsLanguageServiceBuildErrorReporter2.ReportError(
            string bstrErrorMessage,
            string bstrErrorId,
            [ComAliasName("VsShell.VSTASKPRIORITY")] VSTASKPRIORITY nPriority,
            int iLine,
            int iColumn,
            string bstrFileName)
        {
            if (_externalErrorReporter != null)
            {
                return(((IVsLanguageServiceBuildErrorReporter2)_externalErrorReporter).ReportError(
                           bstrErrorMessage,
                           bstrErrorId,
                           nPriority,
                           iLine,
                           iColumn,
                           bstrFileName));
            }

            return(VSConstants.S_OK);
        }
예제 #19
0
        public MyTaskItem(IVsTaskProvider3 provider,
                          string document = "", int line = 0, int column = 0, string text = "", VSTASKCATEGORY category = VSTASKCATEGORY.CAT_USER, __VSERRORCATEGORY errorCategory = __VSERRORCATEGORY.EC_ERROR,
                          IEnumerable <string> customColumnText = null,
                          bool canDelete          = false, bool isChecked   = false, bool isReadOnly = false, bool hasHelp = false, bool customColumnsReadOnly = false,
                          int imageListIndex      = 0, int subcategoryIndex = 0,
                          VSTASKPRIORITY priority = VSTASKPRIORITY.TP_NORMAL)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            this.Provider  = provider;
            _document      = document;
            _line          = line;
            _column        = column;
            _text          = text;
            _category      = category;
            _errorCategory = errorCategory;

            if (customColumnText != null)
            {
                uint index = 0;
                foreach (var s in customColumnText)
                {
                    _customColumnText.Add(index++, s);
                }
            }

            _canDelete             = canDelete;
            _isChecked             = isChecked;
            _isReadOnly            = isReadOnly;
            _hasHelp               = hasHelp;
            _customColumnsReadOnly = customColumnsReadOnly;

            _imageListIndex   = imageListIndex;
            _subcategoryIndex = subcategoryIndex;

            _priority = priority;
        }
예제 #20
0
        public bool IsTaskToken(string text, out VSTASKPRIORITY priority)
        {
            priority = VSTASKPRIORITY.TP_NORMAL;
            if (text == null)
            {
                return(false);
            }
            if (this.taskTokens == null)
            {
                return(false);
            }

            //extract the token
            int i   = 0;
            int len = text.Length;

            while (i < len && Char.IsWhiteSpace(text[i]))
            {
                i++;
            }

            int start = i;

            while (i < len && !Char.IsWhiteSpace(text[i]) &&
                   text[i] != ':')
            {
                i++;
            }
            if (len == 0)
            {
                return(false);
            }

            string token = text.Substring(start, i - start);

            //check if this is a defined token
            return(this.taskTokens.Contains(token));
        }
예제 #21
0
        // Retrieves token settings as defined by user in Tools -> Options -> Environment -> Task List.
        private void RefreshTokens()
        {
            var taskInfo = (IVsCommentTaskInfo)_serviceProvider.GetService(typeof(SVsTaskList));

            if (taskInfo == null)
            {
                _tokens = new Dictionary <string, VSTASKPRIORITY>();
                return;
            }

            IVsEnumCommentTaskTokens enumTokens;

            ErrorHandler.ThrowOnFailure(taskInfo.EnumTokens(out enumTokens));

            var newTokens = new Dictionary <string, VSTASKPRIORITY>();

            var    token = new IVsCommentTaskToken[1];
            uint   fetched;
            string text;
            var    priority = new VSTASKPRIORITY[1];

            // DevDiv bug 1135485: EnumCommentTaskTokens.Next returns E_FAIL instead of S_FALSE
            while (enumTokens.Next(1, token, out fetched) == VSConstants.S_OK && fetched > 0)
            {
                ErrorHandler.ThrowOnFailure(token[0].Text(out text));
                ErrorHandler.ThrowOnFailure(token[0].Priority(priority));
                newTokens[text] = priority[0];
            }

            _tokens = newTokens;

            var tokensChanged = TokensChanged;

            if (tokensChanged != null)
            {
                tokensChanged(this, EventArgs.Empty);
            }
        }
예제 #22
0
            public TaskItemInfo(IVsTaskItem taskItem) {
                ErrorHandler.ThrowOnFailure(taskItem.Document(out Document));
                ErrorHandler.ThrowOnFailure(taskItem.get_Text(out Message));
                ErrorHandler.ThrowOnFailure(taskItem.Line(out Line));
                ErrorHandler.ThrowOnFailure(taskItem.Column(out Column));

                var priority = new VSTASKPRIORITY[1];
                ErrorHandler.ThrowOnFailure(taskItem.get_Priority(priority));
                Priority = priority[0];

                var category = new VSTASKCATEGORY[1];
                ErrorHandler.ThrowOnFailure(taskItem.Category(category));
                Category = category[0];

                var errorItem = taskItem as IVsErrorItem;
                if (errorItem != null) {
                    uint errorCategory;
                    ErrorHandler.ThrowOnFailure(errorItem.GetCategory(out errorCategory));
                    ErrorCategory = (__VSERRORCATEGORY)errorCategory;
                } else {
                    ErrorCategory = null;
                }
            }
예제 #23
0
 public int put_Priority(VSTASKPRIORITY tpPriority)
 {
     return VSConstants.E_NOTIMPL;
 }
예제 #24
0
 /// <include file='doc\Task.uex' path='docs/doc[@for="Task.IVsTaskItem.get_Priority"]/*' />
 /// <internalonly/>
 int IVsTaskItem.get_Priority(VSTASKPRIORITY[] pri)
 {
     if (pri != null) {
         pri[0] = (VSTASKPRIORITY)(uint)Priority;
     }
     return NativeMethods.S_OK;
 }
예제 #25
0
파일: Task.cs 프로젝트: hesam/SketchSharp
 public int get_Priority(VSTASKPRIORITY[] ptpPriority)
 {
   if (ptpPriority != null) {
     switch (priority) {
       case TaskPriority.Low: ptpPriority[0] = VSTASKPRIORITY.TP_LOW; break;
       case TaskPriority.Normal: ptpPriority[0] = VSTASKPRIORITY.TP_NORMAL; break;
       case TaskPriority.High: ptpPriority[0] = VSTASKPRIORITY.TP_HIGH; break;
       default: ptpPriority[0] = VSTASKPRIORITY.TP_NORMAL; break;
     }
   }
   return 0;
 }
예제 #26
0
 protected virtual int PutPriority(VSTASKPRIORITY tpPriority)
 {
     return(VSConstants.E_NOTIMPL);
 }
        // TODO: Use PreserveSig instead of throwing these exceptions for common cases.
        public void ReportError2(string bstrErrorMessage, string bstrErrorId, [ComAliasName("VsShell.VSTASKPRIORITY")] VSTASKPRIORITY nPriority, int iStartLine, int iStartColumn, int iEndLine, int iEndColumn, string bstrFileName)
        {
            // first we check whether given error is something we can take care.
            if (!CanHandle(bstrErrorId))
            {
                // it is not, let project system takes care.
                throw new NotImplementedException();
            }

            if ((iEndLine >= 0 && iEndColumn >= 0) &&
                ((iEndLine < iStartLine) ||
                 (iEndLine == iStartLine && iEndColumn < iStartColumn)))
            {
                throw new ArgumentException(ServicesVSResources.EndPositionMustBeGreaterThanStart);
            }

            var priority = (VSTASKPRIORITY)nPriority;
            DiagnosticSeverity severity;

            switch (priority)
            {
            case VSTASKPRIORITY.TP_HIGH:
                severity = DiagnosticSeverity.Error;
                break;

            case VSTASKPRIORITY.TP_NORMAL:
                severity = DiagnosticSeverity.Warning;
                break;

            case VSTASKPRIORITY.TP_LOW:
                severity = DiagnosticSeverity.Info;
                break;

            default:
                throw new ArgumentException(ServicesVSResources.NotAValidValue, nameof(nPriority));
            }

            if (iStartLine < 0 || iStartColumn < 0)
            {
                // we now takes care of errors that is not belong to file as well.
                var projectDiagnostic = GetDiagnosticData(
                    null, bstrErrorId, bstrErrorMessage, severity,
                    null, 0, 0, 0, 0,
                    bstrFileName, 0, 0, 0, 0);

                _diagnosticProvider.AddNewErrors(_projectId, projectDiagnostic);
                return;
            }

            var hostProject = _workspace.GetHostProject(_projectId);

            if (!hostProject.ContainsFile(bstrFileName))
            {
                var projectDiagnostic = GetDiagnosticData(
                    null, bstrErrorId, bstrErrorMessage, severity,
                    null, iStartLine, iStartColumn, iEndLine, iEndColumn,
                    bstrFileName, iStartLine, iStartColumn, iEndLine, iEndColumn);

                _diagnosticProvider.AddNewErrors(_projectId, projectDiagnostic);
                return;
            }

            var hostDocument = hostProject.GetCurrentDocumentFromPath(bstrFileName);

            var diagnostic = GetDiagnosticData(
                hostDocument.Id, bstrErrorId, bstrErrorMessage, severity,
                null, iStartLine, iStartColumn, iEndLine, iEndColumn,
                bstrFileName, iStartLine, iStartColumn, iEndLine, iEndColumn);

            _diagnosticProvider.AddNewErrors(hostDocument.Id, diagnostic);
        }
 int IVsOutputWindowPane.OutputTaskItemString(string pszOutputString, VSTASKPRIORITY priority, VSTASKCATEGORY category, string pszSubcategory, int bitmap, string pszFilename, uint lineNum, string pszTaskItemText)
 {
     throw new NotImplementedException();
 }
 public int OutputTaskItemString(string pszOutputString, VSTASKPRIORITY nPriority, VSTASKCATEGORY nCategory, string pszSubcategory, int nBitmap, string pszFilename, uint nLineNum, string pszTaskItemText)
 {
     throw new NotImplementedException();
 }
예제 #30
0
        public void IndentationInconsistencyError() {
            using (var app = new PythonVisualStudioApp()) {
                var options = app.Options;
                var severity = options.IndentationInconsistencySeverity;
                options.IndentationInconsistencySeverity = Severity.Error;
                app.OnDispose(() => options.IndentationInconsistencySeverity = severity);

                var project = app.OpenProject(@"TestData\InconsistentIndentation.sln");

                var items = app.WaitForErrorListItems(1);
                Assert.AreEqual(1, items.Count);

                VSTASKPRIORITY[] pri = new VSTASKPRIORITY[1];
                ErrorHandler.ThrowOnFailure(items[0].get_Priority(pri));
                Assert.AreEqual(VSTASKPRIORITY.TP_HIGH, pri[0]);
            }
        }
예제 #31
0
 /// <include file='doc\Task.uex' path='docs/doc[@for="Task.IVsTaskItem.put_Priority"]/*' />
 /// <internalonly/>
 int IVsTaskItem.put_Priority(VSTASKPRIORITY pri)
 {
     priority = (TaskPriority)(uint)pri;
     return NativeMethods.S_OK;
 }
 int IVsLanguageServiceBuildErrorReporter.ReportError(string bstrErrorMessage, string bstrErrorId, VSTASKPRIORITY nPriority, int iLine, int iColumn, string bstrFileName)
 {
     return ((IVsLanguageServiceBuildErrorReporter2)this).ReportError(bstrErrorMessage, bstrErrorId, nPriority, iLine, iColumn, bstrFileName);
 }
		public int OutputTaskItemStringEx(string pszOutputString, VSTASKPRIORITY nPriority, VSTASKCATEGORY nCategory, string pszSubcategory, int nBitmap, string pszFilename, uint nLineNum, string pszTaskItemText, string pszLookupKwd)
		{
			return VSConstants.S_OK;
		}
 int IVsOutputWindowPane.OutputTaskItemString(string pszOutputString, VSTASKPRIORITY nPriority, VSTASKCATEGORY nCategory, string pszSubcategory, int nBitmap, string pszFilename, uint nLineNum, string pszTaskItemText)
 {
     throw new NotImplementedException();
 }
예제 #35
0
 public bool IsTaskToken( string text, out VSTASKPRIORITY priority ) {
   return this.taskTokens.IsTaskToken(text, out priority);
 }
 public int OutputTaskItemStringEx(string pszOutputString, VSTASKPRIORITY nPriority, VSTASKCATEGORY nCategory, string pszSubcategory, int nBitmap, string pszFilename, uint nLineNum, string pszTaskItemText, string pszLookupKwd) {
     throw new NotImplementedException();
 }
예제 #37
0
 /// <include file='doc\Task.uex' path='docs/doc[@for="Task.IVsTaskItem.put_Priority"]/*' />
 /// <internalonly/>
 int IVsTaskItem.put_Priority(VSTASKPRIORITY pri)
 {
     priority = (TaskPriority)(uint)pri;
     return(NativeMethods.S_OK);
 }
예제 #38
0
 public virtual int put_Priority(VSTASKPRIORITY priority){
   this.priority = priority;
   return 0;
 }
예제 #39
0
 public virtual int get_Priority(VSTASKPRIORITY[] priority){
   priority[0] = this.priority;
   return 0;
 }
예제 #40
0
 public bool IsTaskToken(string text, out VSTASKPRIORITY priority)
 {
     return(this.taskTokens.IsTaskToken(text, out priority));
 }
예제 #41
0
파일: Task.cs 프로젝트: hesam/SketchSharp
 public int put_Priority(VSTASKPRIORITY tpPriority)
 {
   switch (tpPriority) {
     case VSTASKPRIORITY.TP_LOW: priority = TaskPriority.Low; break;
     case VSTASKPRIORITY.TP_NORMAL: priority = TaskPriority.Normal; break;
     case VSTASKPRIORITY.TP_HIGH: priority = TaskPriority.High; break;
     // don't do anything in another case
   }
   return 0;
 }
예제 #42
0
 public TaskItem(ServiceProvider site, IVsTextLineMarker textLineMarker, string fileName, string text, bool readOnly, VSTASKCATEGORY cat, VSTASKPRIORITY pri, _vstaskbitmap bitmap, string helpKeyword) {
   this.site = site;
   this.text = text;
   this.fileName = fileName;
   this.textLineMarker = textLineMarker;
   this.helpKeyword = helpKeyword;
   this.category = cat;
   this.priority = pri;
   this.bitmap = bitmap;
   this.readOnly = readOnly;
 }
예제 #43
0
 int IVsTaskItem.put_Priority(VSTASKPRIORITY tpPriority)
 {
     return(PutPriority(tpPriority));
 }
예제 #44
0
 public virtual void get_Priority(VSTASKPRIORITY[] priority){
   priority[0] = this.priority;
 }
예제 #45
0
 public TaskProviderItem FromErrorResult(IServiceProvider serviceProvider, AP.Error result, VSTASKPRIORITY priority, VSTASKCATEGORY category)
 {
     return(new TaskProviderItem(
                serviceProvider,
                result.message,
                GetSpan
                    (result),
                priority,
                category,
                true,
                _spanTranslator
                ));
 }
예제 #46
0
 public virtual void put_Priority(VSTASKPRIORITY priority){
   this.priority = priority;
 }
예제 #47
0
 public TaskProviderItem FromErrorResult(IServiceProvider serviceProvider, ErrorResult result, VSTASKPRIORITY priority, VSTASKCATEGORY category)
 {
     return(new TaskProviderItem(
                serviceProvider,
                result.Message,
                result.Span,
                priority,
                category,
                true,
                _snapshot
                ));
 }
예제 #48
0
    // called when OnCommentTaskInfoChanged is called.
    public void Refresh() {

      //Get token enumerator and allocate memory
      Guid guid = typeof(IVsCommentTaskInfo).GUID;
      IVsCommentTaskInfo commentTaskInfo = null;
      try {
        commentTaskInfo = (IVsCommentTaskInfo)this.site.QueryService(guid, typeof(IVsCommentTaskInfo));
        if (commentTaskInfo == null) return;
      
        int count;
        commentTaskInfo.TokenCount(out count );

        IVsEnumCommentTaskTokens commentTaskTokens = null;
        commentTaskInfo.EnumTokens(out commentTaskTokens );

        Hashtable newTokens = new Hashtable();

        //Get all tokens

        int index = 0;
        for (index = 0; index < count; index++) {
          uint fetched;
          IVsCommentTaskToken[] commentTaskToken = new IVsCommentTaskToken[1];

          commentTaskTokens.Next( 1, commentTaskToken, out fetched );
          if (fetched == 1) {
            string token = null;
            VSTASKPRIORITY[] priority = new VSTASKPRIORITY[1] { VSTASKPRIORITY.TP_NORMAL };
            commentTaskToken[0].Text(out token);            
            commentTaskToken[0].Priority(priority);
            if (token != null) {
              newTokens[token] = priority[0];
            }
          }
        }
        
        //update the token information
        this.taskTokens = newTokens;

      } catch (Exception) {
        return;
      }
    }
 int IVsOutputWindowPane.OutputTaskItemStringEx(string pszOutputString, VSTASKPRIORITY nPriority, VSTASKCATEGORY nCategory,
     string pszSubcategory, int nBitmap, string pszFilename, uint nLineNum, string pszTaskItemText, string pszLookupKwd)
 {
     throw new NotImplementedException();
 }
예제 #50
0
    public bool IsTaskToken( string text, out VSTASKPRIORITY priority ) {
      priority = VSTASKPRIORITY.TP_NORMAL;
      if (text == null) return false;
      if (this.taskTokens == null) return false;

      //extract the token
      int i = 0;
      int len = text.Length;
      while (i < len && Char.IsWhiteSpace(text[i])) {
        i++;
      }

      int start = i;
      while (i < len && !Char.IsWhiteSpace(text[i]) && 
        text[i] != ':' ) { 
        i++;
      }
      if (len == 0) return false;
  
      string token = text.Substring(start, i-start); 

      //check if this is a defined token
      return this.taskTokens.Contains(token);
    }
예제 #51
0
 public virtual void put_Priority(VSTASKPRIORITY priority)
 {
     this.priority = priority;
 }
 int IVsOutputWindowPane.OutputTaskItemStringEx(string pszOutputString, VSTASKPRIORITY priority, VSTASKCATEGORY category, string pszSubcategory, int bitmap, string pszFilename, uint lineNum, string pszTaskItemText, string pszLookupKwd)
 {
     throw new NotImplementedException();
 }