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


C# MemberModel.ToString方法代码示例

本文整理汇总了C#中MemberModel.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# MemberModel.ToString方法的具体用法?C# MemberModel.ToString怎么用?C# MemberModel.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MemberModel的用法示例。


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

示例1: TextParameters

        public TextParameters(MemberModel member)
        {
            this.text = member.ToString();

            //if(member.Comments!=null)
            //this.comments = member.Comments.Split('@');
            this.comments = member.Comments;
        }
开发者ID:fordream,项目名称:wanghe-project,代码行数:8,代码来源:TextParameters.cs

示例2: MemberTreeNode

        public MemberTreeNode(MemberModel memberModel, int imageIndex, bool labelPropertiesLikeFunctions)
            : base(memberModel.ToString(), imageIndex, imageIndex)
        {
            if (labelPropertiesLikeFunctions &&
                (memberModel.Flags & (FlagType.Setter | FlagType.Getter)) != 0)
            {
                var paramList = string.Empty;
                if (memberModel.Parameters != null)
                    paramList = string.Join(", ", memberModel.Parameters.Select(p => string.Format("{0}:{1}", p.Name, p.Type)).ToArray());

                Label = string.Format("{0} ({1}) : {2}", memberModel.Name, paramList, memberModel.Type);
            }
            else
            {
                Label = Text;
            }

            Model = memberModel;
            Tag = memberModel.Name + "@" + memberModel.LineFrom;
        }
开发者ID:Neverbirth,项目名称:fd-navigationbar,代码行数:20,代码来源:MemberTreeNode.cs

示例3: MemberDeclaration

        static public string MemberDeclaration(MemberModel member, bool preventVisibility)
        {
            // modifiers
            FlagType ft = member.Flags;
            Visibility acc = member.Access;
            string modifiers = "";
            if ((ft & FlagType.Intrinsic) > 0)
            {
                if ((ft & FlagType.Extern) > 0) modifiers += "extern ";
                else modifiers += "intrinsic ";
            }
            else if (!string.IsNullOrEmpty(member.Namespace) 
                && member.Namespace != "internal")
            {
                if ((ft & FlagType.Interface) == 0)
                    modifiers = member.Namespace + " ";
            }
            else if (!preventVisibility)
            {
                if ((member.Flags & FlagType.Interface) == 0)
                {
                    if ((acc & Visibility.Public) > 0) modifiers += "public ";
                //  else if ((acc & Visibility.Internal) > 0) modifiers += "internal "; // AS3 default
                    else if ((acc & Visibility.Protected) > 0) modifiers += "protected ";
                    else if ((acc & Visibility.Private) > 0) modifiers += "private ";
                }
            }

            if ((ft & FlagType.Final) > 0)
                modifiers += "final ";

            if ((ft & FlagType.Enum) > 0)
            {
                return member.ToString();
            }
            else if ((ft & FlagType.Class) > 0)
            {
                if ((ft & FlagType.Dynamic) > 0)
                    modifiers += "dynamic ";
                string classType = "class";
                if ((member.Flags & FlagType.Interface) > 0) classType = "interface";
                else if ((member.Flags & FlagType.Enum) > 0) classType = "enum";
                else if ((member.Flags & FlagType.Abstract) > 0) classType = "abstract";
                else if ((member.Flags & FlagType.TypeDef) > 0) classType = "typedef";
                else if ((member.Flags & FlagType.Struct) > 0) classType = "struct";
                else if ((member.Flags & FlagType.Delegate) > 0) classType = "delegate";
                return String.Format("{0}{1} {2}", modifiers, classType, member.Type);
            }
            else if ((ft & FlagType.Enum) == 0)
            {
                if ((ft & FlagType.Native) > 0)
                    modifiers += "native ";
                if ((ft & FlagType.Static) > 0)
                    modifiers += "static ";
            }

            // signature
            if ((ft & FlagType.Namespace) > 0)
            {
                return String.Format("{0}namespace {1}", modifiers, member.Name);
            }
            else if ((ft & FlagType.Variable) > 0)
            {
                if ((ft & FlagType.LocalVar) > 0) modifiers = "local ";
                if ((ft & FlagType.Constant) > 0)
                {
                    if (member.Value == null)
                        return String.Format("{0}const {1}", modifiers, member.ToDeclarationString());
                    else
                        return String.Format("{0}const {1} = {2}", modifiers, member.ToDeclarationString(), member.Value);
                }
                else return String.Format("{0}var {1}", modifiers, member.ToDeclarationString());
            }
            else if ((ft & (FlagType.Getter | FlagType.Setter)) > 0)
                return String.Format("{0}property {1}", modifiers, member.ToString());
            else if ((ft & FlagType.Delegate) > 0)
                return String.Format("{0}delegate {1}", modifiers, member.ToString());
            else if ((ft & FlagType.Function) > 0)
                return String.Format("{0}function {1}", modifiers, member.ToString());
            else if (ft == FlagType.Package)
                return String.Format("Package {0}", member.Type);
            else if (ft == FlagType.Template)
                return String.Format("Template {0}", member.Type);
            else if (ft == FlagType.Declaration)
                return String.Format("Declaration {0}", member.Type);
            else
                return String.Format("{0}type {1}", modifiers, member.Type);
        }
开发者ID:ImaginationSydney,项目名称:flashdevelop,代码行数:88,代码来源:ClassModel.cs


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