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


C# Declaration类代码示例

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


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

示例1: VisitDeclaration

        public override bool VisitDeclaration(Declaration decl)
        {
            if (!base.VisitDeclaration(decl))
                return false;

            if (Driver.Options.IsCSharpGenerator)
            {
                // C# cannot have protected members in static classes.
                var @class = decl.Namespace as Class;
                if (    decl.Access == AccessSpecifier.Protected &&
                        decl.GenerationKind == GenerationKind.Generate &&
                        @class != null &&
                        @class.IsStatic)
                {
                    // By setting it to private it will appear
                    // as an internal in the final C# wrapper.
                    decl.Access = AccessSpecifier.Private;

                    // We need to explicity set the generation else the
                    // now private declaration will get filtered out later.
                    decl.GenerationKind = GenerationKind.Generate;
                }
            }

            return true;
        }
开发者ID:nalkaro,项目名称:CppSharp,代码行数:26,代码来源:CheckStaticClass.cs

示例2: IntellisenseItem

        public IntellisenseItem(Declaration dtt)
        {
            Overrides = new List<IntellisenseOverride>();
            Name = dtt.Name;
            Glyph = dtt.Glyph;

            StringBuilder docs = new StringBuilder();
            foreach (var element in dtt.DescriptionText.Item)
            {
                if (element.IsDataTipElement)
                {
                    var x = (DataTipElement.DataTipElement)element;
                    Documentation = x.Item1;
                }
                else if (element.IsDataTipElementGroup)
                {
                    foreach (var subElement in ((DataTipElement.DataTipElementGroup)element).Item)
                    {
                        docs.AppendLine(subElement.Item1);
                        Overrides.Add(new IntellisenseOverride
                        {
                            Name = subElement.Item1
                        });
                    }
                }
            }

            if (String.IsNullOrEmpty(Documentation))
            {
                Documentation = docs.ToString();
            }
        }
开发者ID:panesofglass,项目名称:FSharpWebIntellisense,代码行数:32,代码来源:IntellisenseItem.cs

示例3: CheckDeclarationAccess

        public bool CheckDeclarationAccess(Declaration decl)
        {
            var generateNonPublicDecls = Driver.Options.IsCSharpGenerator;

            switch (decl.Access)
            {
                case AccessSpecifier.Public:
                    return true;
                case AccessSpecifier.Protected:
                    var @class = decl.Namespace as Class;
                    if (@class != null && @class.IsValueType)
                        return false;
                    return generateNonPublicDecls;
                case AccessSpecifier.Private:
                    var method = decl as Method;
                    var isOverride = false;
                    if (method != null && method.IsOverride)
                    {
                        var baseMethod = ((Class) method.Namespace).GetBaseMethod(method);
                        isOverride = baseMethod.IsGenerated;
                    }
                    return generateNonPublicDecls && (isOverride || decl.IsExplicitlyGenerated);
            }

            return true;
        }
开发者ID:ymlai87416,项目名称:CppSharp,代码行数:26,代码来源:CheckIgnoredDecls.cs

示例4: Add

    public void Add(Declaration d)
    {
        if (d == null)
            return;

        decls.Add (d);
    }
开发者ID:nagyist,项目名称:monotouch-binding-generator,代码行数:7,代码来源:parse.cs

示例5: GetMethod

        public static AddSignatures GetMethod(Declaration dec)
        {
            switch (dec.PropertyName.Text.ToLowerInvariant())
            {
                case "margin":
                case "padding":
                case "border-width":
                case "outline-width":
                    return Margins;

                case "border-radius":
                    return Corners;

                case "border":
                    return Borders;

                case "font":
                    return Fonts;

                case "columns":
                    return Columns;
            }

            return null;
        }
开发者ID:GProulx,项目名称:WebEssentials2013,代码行数:25,代码来源:ValueOrderFactory.cs

示例6: GenericSetter

 public GenericSetter(Token Source, Declaration Function, String MemberName, Node Object)
     : base(Source)
 {
     this.Function = Function;
     this.Object = Object;
     this.MemberName = MemberName;
 }
开发者ID:Blecki,项目名称:EtcScript,代码行数:7,代码来源:GenericSetter.cs

示例7: VisitDeclaration

        public override bool VisitDeclaration(Declaration decl)
        {
            if (decl.CompleteDeclaration != null)
                return true;

            return !decl.IsIncomplete;
        }
开发者ID:jijamw,项目名称:CppSharp,代码行数:7,代码来源:Types.cs

示例8: DocumentRoot

 /// <summary>
 /// Initializes a new instance of the DocumentRoot class.
 /// </summary>
 /// <param name="document">
 /// The document that this element belongs to.
 /// </param>
 /// <param name="declaration">
 /// The declaration class for this element.
 /// </param>
 /// <param name="generated">
 /// Indicates whether the element contains generated code.
 /// </param>
 internal DocumentRoot(CsDocument document, Declaration declaration, bool generated)
     : base(document, null, ElementType.Root, Strings.DocumentRoot, null, null, declaration, false, generated)
 {
     Param.AssertNotNull(document, "document");
     Param.AssertNotNull(declaration, "declaration");
     Param.Ignore(generated);
 }
开发者ID:transformersprimeabcxyz,项目名称:_TO-FIRST-stylecop,代码行数:19,代码来源:DocumentRoot.cs

示例9: ExplicitIndexSetter

 public ExplicitIndexSetter(Token Source, Declaration Function, Node Object, Node Index)
     : base(Source)
 {
     this.Function = Function;
     this.Object = Object;
     this.Index = Index;
 }
开发者ID:Blecki,项目名称:EtcScript,代码行数:7,代码来源:ExplicitIndexSetter.cs

示例10: VisitDeclaration

        public override bool VisitDeclaration(Declaration decl)
        {
            if (AlreadyVisited(decl))
                return false;

            if (decl.GenerationKind == GenerationKind.None)
                return true;

            if (!CheckDeclarationAccess(decl))
            {
                Log.Debug("Decl '{0}' was ignored due to invalid access",
                    decl.Name);
                decl.GenerationKind = decl is Field ? GenerationKind.Internal : GenerationKind.None;
                return true;
            }

            if (decl.IsDependent)
            {
                decl.GenerationKind = decl is Field ? GenerationKind.Internal : GenerationKind.None;
                Log.Debug("Decl '{0}' was ignored due to dependent context",
                    decl.Name);
                return true;
            }

            return true;
        }
开发者ID:daxiazh,项目名称:CppSharp,代码行数:26,代码来源:CheckIgnoredDecls.cs

示例11: RenderDeclaration

 public static void RenderDeclaration(StringBuilder sb, Declaration decl)
 {
     sb.AppendFormat("{0}:", decl.Name);
     RenderExpression(sb, decl.Expression);
     if (decl.Important)
         sb.Append(" !important");
 }
开发者ID:bpaciao,项目名称:pagereleaser,代码行数:7,代码来源:CSSRenderer.cs

示例12: VisitDeclaration

        public override bool VisitDeclaration(Declaration decl)
        {
            if (AlreadyVisited(decl))
                return false;

            return !decl.Ignore;
        }
开发者ID:kidleon,项目名称:CppSharp,代码行数:7,代码来源:ResolveIncompleteDeclsPass.cs

示例13: VisitDeclaration

        public override bool VisitDeclaration(Declaration decl)
        {
            if (AlreadyVisited(decl))
                return false;

            if (decl.ExplicityIgnored)
                return true;

            if (!CheckDeclarationAccess(decl))
            {
                Log.Debug("Decl '{0}' was ignored due to invalid access",
                    decl.Name);
                decl.ExplicityIgnored = true;
                return true;
            }

            if (decl.IsDependent)
            {
                decl.ExplicityIgnored = true;
                Log.Debug("Decl '{0}' was ignored due to dependent context",
                    decl.Name);
                return true;
            }

            return true;
        }
开发者ID:kidleon,项目名称:CppSharp,代码行数:26,代码来源:CheckIgnoredDecls.cs

示例14: IsSupportedStdType

 private static bool IsSupportedStdType(Declaration declaration)
 {
     return declaration.Namespace != null &&
         declaration.TranslationUnit.IsSystemHeader &&
         IsNameSpaceStd(declaration.Namespace) &&
         supportedStdTypes.Contains(declaration.OriginalName);
 }
开发者ID:ddobrev,项目名称:CppSharp,代码行数:7,代码来源:MarkSupportedClassTemplateSpecializationsPass.cs

示例15: VisitDeclaration

        public override bool VisitDeclaration(Declaration decl)
        {
            if (AlreadyVisited(decl))
                return false;

            return decl.IsGenerated;
        }
开发者ID:corefan,项目名称:CppSharp,代码行数:7,代码来源:ResolveIncompleteDeclsPass.cs


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