当前位置: 首页>>代码示例>>C#>>正文


C# DiagnosticInfo类代码示例

本文整理汇总了C#中DiagnosticInfo的典型用法代码示例。如果您正苦于以下问题:C# DiagnosticInfo类的具体用法?C# DiagnosticInfo怎么用?C# DiagnosticInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DiagnosticInfo类属于命名空间,在下文中一共展示了DiagnosticInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExtendedErrorTypeSymbol

 internal ExtendedErrorTypeSymbol(NamespaceOrTypeSymbol containingSymbol, ImmutableArray<Symbol> candidateSymbols, LookupResultKind resultKind, DiagnosticInfo errorInfo, int arity, bool unreported = false)
     : this(containingSymbol, candidateSymbols[0].Name, arity, errorInfo, unreported)
 {
     _candidateSymbols = UnwrapErrorCandidates(candidateSymbols);
     _resultKind = resultKind;
     Debug.Assert(candidateSymbols.IsEmpty || resultKind != LookupResultKind.Viable, "Shouldn't use LookupResultKind.Viable with candidate symbols");
 }
开发者ID:GloryChou,项目名称:roslyn,代码行数:7,代码来源:ExtendedErrorTypeSymbol.cs

示例2: PEFieldSymbol

        internal PEFieldSymbol(
            PEModuleSymbol moduleSymbol,
            PENamedTypeSymbol containingType,
            FieldDefinitionHandle fieldDef)
        {
            Debug.Assert((object)moduleSymbol != null);
            Debug.Assert((object)containingType != null);
            Debug.Assert(!fieldDef.IsNil);

            _handle = fieldDef;
            _containingType = containingType;

            try
            {
                moduleSymbol.Module.GetFieldDefPropsOrThrow(fieldDef, out _name, out _flags);
            }
            catch (BadImageFormatException)
            {
                if ((object)_name == null)
                {
                    _name = String.Empty;
                }

                _lazyUseSiteDiagnostic = new CSDiagnosticInfo(ErrorCode.ERR_BindToBogus, this);
            }
        }
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:26,代码来源:PEFieldSymbol.cs

示例3: TestDiagnostic

        public void TestDiagnostic()
        {
            MockMessageProvider provider = new MockMessageProvider();
            SyntaxTree syntaxTree = new MockSyntaxTree();
            CultureInfo englishCulture = CultureHelpers.EnglishCulture;

            DiagnosticInfo di1 = new DiagnosticInfo(provider, 1);
            Assert.Equal(1, di1.Code);
            Assert.Equal(DiagnosticSeverity.Error, di1.Severity);
            Assert.Equal("MOCK0001", di1.MessageIdentifier);
            Assert.Equal("The first error", di1.GetMessage(englishCulture));

            DiagnosticInfo di2 = new DiagnosticInfo(provider, 1002, "Elvis", "Mort");
            Assert.Equal(1002, di2.Code);
            Assert.Equal(DiagnosticSeverity.Warning, di2.Severity);
            Assert.Equal("MOCK1002", di2.MessageIdentifier);
            Assert.Equal("The second warning about Elvis and Mort", di2.GetMessage(englishCulture));

            Location l1 = new SourceLocation(syntaxTree, new TextSpan(5, 8));
            var d1 = new CSDiagnostic(di2, l1);
            Assert.Equal(l1, d1.Location);
            Assert.Same(syntaxTree, d1.Location.SourceTree);
            Assert.Equal(new TextSpan(5, 8), d1.Location.SourceSpan);
            Assert.Equal(0, d1.AdditionalLocations.Count());
            Assert.Same(di2, d1.Info);
        }
开发者ID:rgani,项目名称:roslyn,代码行数:26,代码来源:DiagnosticTest.cs

示例4: PopulateHelper

 private void PopulateHelper(BoundExpression receiverOpt, LookupResultKind resultKind, DiagnosticInfo error)
 {
     VerifyClear();
     this.Receiver = receiverOpt;
     this.Error = error;
     this.ResultKind = resultKind;
 }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:7,代码来源:MethodGroup.cs

示例5: LazyObsoleteDiagnosticInfo

 internal LazyObsoleteDiagnosticInfo(Symbol symbol, Symbol containingSymbol, BinderFlags binderFlags)
     : base(CSharp.MessageProvider.Instance, (int)ErrorCode.Unknown)
 {
     this.symbol = symbol;
     this.containingSymbol = containingSymbol;
     this.binderFlags = binderFlags;
     this.lazyActualObsoleteDiagnostic = null;
 }
开发者ID:riversky,项目名称:roslyn,代码行数:8,代码来源:LazyObsoleteDiagnosticInfo.cs

示例6: ApplyDiagnosticMasks

 /// <summary>
 /// Applies the diagnostic mask if the object was initialize with a ServiceResult.
 /// </summary>
 public void ApplyDiagnosticMasks(DiagnosticsMasks diagnosticMasks, StringTable stringTable)
 {
     if (m_result != null)
     {
         m_statusCode     = m_result.StatusCode;
         m_diagnosticInfo = new DiagnosticInfo(m_result, diagnosticMasks, false, stringTable);
     }
 }
开发者ID:OPCFoundation,项目名称:UA-.NETStandardLibrary,代码行数:11,代码来源:StatusResult.cs

示例7: TupleErrorFieldSymbol

 public TupleErrorFieldSymbol(NamedTypeSymbol container, string name, int tupleFieldId, Location location, TypeSymbol type, DiagnosticInfo useSiteDiagnosticInfo)
     : base(container, name, isPublic:true, isReadOnly:false, isStatic:false)
 {
     Debug.Assert(name != null);
     _type = type;
     _locations = location == null ? ImmutableArray<Location>.Empty : ImmutableArray.Create(location);
     _useSiteDiagnosticInfo = useSiteDiagnosticInfo;
     _tupleFieldId = tupleFieldId;
 }
开发者ID:Rickinio,项目名称:roslyn,代码行数:9,代码来源:TupleErrorFieldSymbol.cs

示例8: SyntaxIdentifierWithTrailingTrivia

 internal SyntaxIdentifierWithTrailingTrivia(string text, GreenNode trailing, DiagnosticInfo[] diagnostics, SyntaxAnnotation[] annotations)
     : base(text, diagnostics, annotations)
 {
     if (trailing != null)
     {
         this.AdjustFlagsAndWidth(trailing);
         _trailing = trailing;
     }
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:9,代码来源:SyntaxToken.SyntaxIdentifierWithTrailingTrivia.cs

示例9: WithTwoChildren

 internal WithTwoChildren(DiagnosticInfo[] diagnostics, SyntaxAnnotation[] annotations, GreenNode child0, GreenNode child1)
     : base(diagnostics, annotations)
 {
     this.SlotCount = 2;
     this.AdjustFlagsAndWidth(child0);
     _child0 = child0;
     this.AdjustFlagsAndWidth(child1);
     _child1 = child1;
 }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:9,代码来源:SyntaxList.WithTwoChildren.cs

示例10: PopulateWithSingleMethod

 internal void PopulateWithSingleMethod(
     BoundExpression receiverOpt,
     MethodSymbol method,
     LookupResultKind resultKind = LookupResultKind.Viable,
     DiagnosticInfo error = null)
 {
     this.PopulateHelper(receiverOpt, resultKind, error);
     this.Methods.Add(method);
 }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:9,代码来源:MethodGroup.cs

示例11: TupleErrorFieldSymbol

 public TupleErrorFieldSymbol(NamedTypeSymbol container, string name, int tupleElementIndex, Location location, TypeSymbol type, DiagnosticInfo useSiteDiagnosticInfo, bool isImplicitlyDeclared)
     : base(container, name, isPublic:true, isReadOnly:false, isStatic:false)
 {
     Debug.Assert(name != null);
     _type = type;
     _locations = location == null ? ImmutableArray<Location>.Empty : ImmutableArray.Create(location);
     _useSiteDiagnosticInfo = useSiteDiagnosticInfo;
     _tupleElementIndex = tupleElementIndex;
     _isImplicitlyDeclared = isImplicitlyDeclared;
 }
开发者ID:jkotas,项目名称:roslyn,代码行数:10,代码来源:TupleErrorFieldSymbol.cs

示例12: CreateTypeArguments

 public static ImmutableArray<TypeWithModifiers> CreateTypeArguments(ImmutableArray<TypeParameterSymbol> typeParameters, int n, DiagnosticInfo errorInfo)
 {
     var result = ArrayBuilder<TypeWithModifiers>.GetInstance();
     for (int i = 0; i < n; i++)
     {
         string name = (i < typeParameters.Length) ? typeParameters[i].Name : string.Empty;
         result.Add(new TypeWithModifiers(new UnboundArgumentErrorTypeSymbol(name, errorInfo)));
     }
     return result.ToImmutableAndFree();
 }
开发者ID:RoryVL,项目名称:roslyn,代码行数:10,代码来源:UnboundGenericType.cs

示例13: DiagnosticInfo

 public DiagnosticInfo(int namespaceUri = -1, int symbolicId = -1, int locale = -1, int localizedText = -1, string additionalInfo = null, StatusCode innerStatusCode = default(StatusCode), DiagnosticInfo innerDiagnosticInfo = null)
 {
     this.NamespaceUri = namespaceUri;
     this.SymbolicId = symbolicId;
     this.Locale = locale;
     this.LocalizedText = localizedText;
     this.AdditionalInfo = additionalInfo;
     this.InnerStatusCode = innerStatusCode;
     this.InnerDiagnosticInfo = innerDiagnosticInfo;
 }
开发者ID:yuriik83,项目名称:workstation-uaclient,代码行数:10,代码来源:DiagnosticInfo.cs

示例14: Run

 public override int Run(TextWriter consoleOutput, CancellationToken cancellationToken = default(CancellationToken))
 {
     try
     {
         return base.Run(consoleOutput, cancellationToken);
     }
     catch (OperationCanceledException)
     {
         DiagnosticInfo diag = new DiagnosticInfo(MessageProvider, (int)ErrorCode.ERR_CompileCancelled);
         PrintErrors(new[] { diag }, consoleOutput);
         return 1;
     }
 }
开发者ID:riversky,项目名称:roslyn,代码行数:13,代码来源:CSharpCompiler.cs

示例15: SyntaxTokenWithTrivia

 internal SyntaxTokenWithTrivia(SyntaxKind kind, CSharpSyntaxNode leading, CSharpSyntaxNode trailing, DiagnosticInfo[] diagnostics, SyntaxAnnotation[] annotations)
     : base(kind, diagnostics, annotations)
 {
     if (leading != null)
     {
         this.AdjustFlagsAndWidth(leading);
         this.LeadingField = leading;
     }
     if (trailing != null)
     {
         this.AdjustFlagsAndWidth(trailing);
         this.TrailingField = trailing;
     }
 }
开发者ID:EkardNT,项目名称:Roslyn,代码行数:14,代码来源:SyntaxToken.SyntaxTokenWithTrivia.cs


注:本文中的DiagnosticInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。