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


C# this.AddChild方法代码示例

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


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

示例1: Property

 /// <summary>
 /// Add a property to a <see cref="FunctionBody"/>
 /// </summary>
 /// <param name="functionBody"><see cref="FunctionBody"/> to add to</param>
 /// <param name="name">Name of the property to add</param>
 /// <param name="callback"><see cref="Action{PropertyAssignment}"/> that gets called for working with the <see cref="PropertyAssignment"/></param>
 /// <returns>Chained <see cref="FunctionBody"/> to keep building on</returns>
 public static FunctionBody Property(this FunctionBody functionBody, string name, Action<PropertyAssignment> callback)
 {
     var propertyAssignment = new PropertyAssignment(name);
     functionBody.AddChild(propertyAssignment);
     callback(propertyAssignment);
     return functionBody;
 }
开发者ID:JoB70,项目名称:Bifrost,代码行数:14,代码来源:FunctionExtensions.cs

示例2: AssignAccessor

 /// <summary>
 /// Add a <see cref="AccessorAssignment"/> to the <see cref="FunctionBody"/>
 /// </summary>
 /// <param name="functionBody"><see cref="FunctionBody"/> to add to</param>
 /// <param name="name">Name of the property to add</param>
 /// <param name="callback"><see cref="Action{AccessorAssignment}"/> that gets called for working with the <see cref="AccessorAssignment"/></param>
 /// <returns>Chained <see cref="FunctionBody"/> to keep building on</returns>
 public static FunctionBody AssignAccessor(this FunctionBody functionBody, string name, Action<AccessorAssignment> callback)
 {
     var accessorAssignment = new AccessorAssignment(name);
     functionBody.AddChild(accessorAssignment);
     callback(accessorAssignment);
     return functionBody;
 }
开发者ID:JoB70,项目名称:Bifrost,代码行数:14,代码来源:FunctionExtensions.cs

示例3: setFirstChild

 public static void setFirstChild( this ITree tree, ITree child )
 {
     if ( tree.ChildCount == 0 )
         tree.AddChild( child );
     else
         tree.SetChild( 0, child );
 }
开发者ID:biddyweb,项目名称:azfone-ios,代码行数:7,代码来源:TreeExtensions.cs

示例4: add_Method

        public static MethodDeclaration add_Method(this TypeDeclaration typeDeclaration, string methodName, Dictionary<string, object> invocationParameters, BlockStatement body)
        {
            var newMethod = new MethodDeclaration
            {
                Name = methodName,
                //Modifier = Modifiers.None | Modifiers.Public | Modifiers.Static,
                Modifier = Modifiers.None | Modifiers.Public,
                Body = body
            };
            newMethod.setReturnType();
            if (invocationParameters != null)

                foreach (var invocationParameter in invocationParameters)
                {
                    var parameterType = new TypeReference(
                        (invocationParameter.Value != null && invocationParameter.Key != "returnData")
                        ? invocationParameter.Value.typeFullName()
                        : "System.Object", true);
                    var parameter = new ParameterDeclarationExpression(parameterType, invocationParameter.Key);
                    newMethod.Parameters.Add(parameter);

                }
            typeDeclaration.AddChild(newMethod);
            return newMethod;
        }
开发者ID:SiGhTfOrbACQ,项目名称:O2.Platform.Projects,代码行数:25,代码来源:MethodDeclaration_ExtensionMethods.cs

示例5: AddChild

 public static DomElement AddChild(this DomElement elem, string elementName, out DomElement elemExit)
 {
     var newchild = elem.OwnerDocument.CreateElement(elementName);
     elem.AddChild(newchild);
     elemExit = newchild;
     return newchild;
 }
开发者ID:prepare,项目名称:HTML-Renderer,代码行数:7,代码来源:HtmlDomExtension.cs

示例6: add_Type

        // create
        public static TypeDeclaration add_Type(this NamespaceDeclaration namespaceDeclaration, IClass iClass)
        {
            // move to method IClass.typeDeclaration();
            var typeName = iClass.Name;

            var newType = namespaceDeclaration.type(typeName);		// check if already exists and if it does return it
            if (newType != null)
                return newType;

            const Modifiers modifiers = Modifiers.None | Modifiers.Public;
            newType = new TypeDeclaration(modifiers, new List<AttributeSection>());
            newType.Name = typeName;

            foreach (var baseType in iClass.BaseTypes)
            {
                if (baseType.FullyQualifiedName != "System.Object")  // no need to include this one
                    newType.BaseTypes.Add(new TypeReference(baseType.FullyQualifiedName));
            }

            namespaceDeclaration.AddChild(newType);

            return newType;

            //return namespaceDeclaration.add_Type(iClass.Name);
        }
开发者ID:njmube,项目名称:FluentSharp,代码行数:26,代码来源:TypeDeclaration_ExtensionMethods.cs

示例7: Access

 /// <summary>
 /// Add a accessor accessing an object
 /// </summary>
 /// <param name="functionBody"><see cref="FunctionBody"/> to add to</param>
 /// <param name="name">Name of variant</param>
 /// <param name="callback"><see cref="Action{Accessor}"/> that gets called for working with the <see cref="Accessor"/></param>
 /// <returns>Chained <see cref="FunctionBody"/> to keep building on</returns>
 public static FunctionBody Access(this FunctionBody functionBody, string name, Action<Accessor> callback)
 {
     var accessor = new Accessor(name);
     functionBody.AddChild(accessor);
     callback(accessor);
     return functionBody;
 }
开发者ID:JoB70,项目名称:Bifrost,代码行数:14,代码来源:FunctionExtensions.cs

示例8: FunctionCall

 /// <summary>
 /// Specify a <see cref="FunctionCall"/> for the <see cref="Scope"/>
 /// </summary>
 /// <param name="scope"><see cref="Scope"/> to specify for</param>
 /// <param name="callback"><see cref="Action{FunctionCall}"/> that gets called for setting up the <see cref="FunctionCall"/></param>
 /// <returns>Chained <see cref="Scope"/> to keep building on</returns>
 public static Scope FunctionCall(this Scope scope, Action<FunctionCall> callback)
 {
     var functionCall = new FunctionCall();
     scope.AddChild(functionCall);
     callback(functionCall);
     return scope;
 }
开发者ID:LenFon,项目名称:Bifrost,代码行数:13,代码来源:ScopeExtensions.cs

示例9: AddChildTypeDeclaration

        public static void AddChildTypeDeclaration(this AstNode tree, TypeDeclaration newClass,
            NamespaceDeclaration parentNamespace = null)
        {
            if (null != parentNamespace)
            {
                var newNamespaceNode = new NamespaceDeclaration(
                    parentNamespace.Name);

                newNamespaceNode.AddMember(newClass);

                tree.AddChild(newNamespaceNode, SyntaxTree.MemberRole);
            }
            else
            {
                tree.AddChild(newClass, Roles.TypeMemberRole);
            }
        }
开发者ID:prescottadam,项目名称:pMixins,代码行数:17,代码来源:SyntaxTreeExtensions.cs

示例10: AddStatement

 public static void AddStatement(this BlockStatement block, Statement statement)
 {
     if (block == null)
         throw new ArgumentNullException("block");
     if (statement == null)
         throw new ArgumentNullException("statement");
     block.AddChild(statement);
     statement.Parent = block;
 }
开发者ID:richardschneider,项目名称:ILSpy,代码行数:9,代码来源:StatementBuilder.cs

示例11: AddChild

 /// <summary>
 /// Add a child validation item.
 /// </summary>
 /// <param name="item"></param>
 /// <param name="xpath"></param>
 /// <param name="children"></param>
 /// <param name="relative">Is the xpath relative to the child xpath</param>
 /// <returns></returns>
 public static XPathValidator AddChild(this XPathValidator item, string xpath, IList<IXPathValidator> children = null, bool relative = false)
 {
     if (relative)
     {
         xpath = item.XPath + "/" + xpath;
     }
     var child = new XPathValidator { XPath = xpath, Children = children };
     return item.AddChild(child);
 }
开发者ID:RustyF,项目名称:EnergyTrading-Core,代码行数:17,代码来源:XPathValidatorExtensions.cs

示例12: AddDescription

 public static SKLabelNode AddDescription(this SKNode self, string description, PointF position)
 {
     SKLabelNode label = new SKLabelNode ("Helvetica") {
         Text = description,
         FontSize = 18,
         Position = position
     };
     self.AddChild (label);
     return label;
 }
开发者ID:BoogieMAN2K,项目名称:monotouch-samples,代码行数:10,代码来源:Extensions.cs

示例13: WrapWithHtmlTag

        public static void WrapWithHtmlTag(this HtmlNode node)
        {
            var pTag = new HtmlTagNode("p");
            foreach (var child in node.Children)
                pTag.AddChild(child);

            var htmlTag = new HtmlTagNode("html");
            htmlTag.AddChild(pTag);

            node.Children.Clear();
            node.AddChild(htmlTag);
        }
开发者ID:jogibear9988,项目名称:MyToolkit,代码行数:12,代码来源:HtmlNodeExtensions.cs

示例14: AddMetaDataEntry

		public static void AddMetaDataEntry(this XmlData projectMetaData,
			ContentMetaData contentEntry)
		{
			var newEntry = new XmlData(typeof(ContentMetaData).Name);
			AddBasicMetaDataValues(newEntry, contentEntry);
			if (contentEntry.Language != null)
				newEntry.AddAttribute("Language", contentEntry.Language);
			if (contentEntry.PlatformFileId != 0)
				newEntry.AddAttribute("PlatformFileId", contentEntry.PlatformFileId);
			foreach (KeyValuePair<string, string> valuePair in contentEntry.Values)
				newEntry.AddAttribute(valuePair.Key, valuePair.Value);
			projectMetaData.AddChild(newEntry);
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:13,代码来源:XmlMetaDataExtensions.cs

示例15: add_Type

        /*public static TypeDeclaration add_Type(this CompilationUnit compilationUnit, IReturnType iReturnType)
        { 
           
        }*/

        public static TypeDeclaration add_Type(this CompilationUnit compilationUnit, IClass iClass)
        {
            try
            {       
                if (iClass.Namespace.valid())
                {
                    var namespaceDeclaration = compilationUnit.add_Namespace(iClass.Namespace);
                    return namespaceDeclaration.add_Type(iClass);
                }

                // move to method IClass.typeDeclaration();
                var typeName = iClass.Name;

                var newType = compilationUnit.type(typeName);		// check if already exists and if it does return it
                if (newType != null)
                    return newType;

                const Modifiers modifiers = Modifiers.None | Modifiers.Public;
                newType = new TypeDeclaration(modifiers, new List<AttributeSection>())
                {
                    Name = typeName
                };

                foreach (var baseType in iClass.BaseTypes)
                {
                    newType.BaseTypes.Add(new TypeReference(baseType.FullyQualifiedName));
                }

                compilationUnit.AddChild(newType);

                return newType;
              //  return newType;


                /*var classFinder = new ClassFinder(iClass,0,0);
                var typeReference = (TypeReference)ICSharpCode.SharpDevelop.Dom.Refactoring.CodeGenerator.ConvertType(iClass.DefaultReturnType, classFinder);
                if (typeReference != null)
                { 
                    compilationUnit.AddChild(typeReference);
                    return typeReference;
                }*/
                //return compilationUnit.add_Type_(iClass.Namespace, iClass.Name);
            }
            catch (Exception ex)
            {
                ex.log("in TypeReference.add_Type");                
            }
            return compilationUnit.add_Type(iClass.Namespace, iClass.Name);
        }
开发者ID:SiGhTfOrbACQ,项目名称:O2.Platform.Projects,代码行数:54,代码来源:TypeDeclaration_ExtensionMethods.cs


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