コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NotificationMethodGenerator"/> class.
        /// </summary>
        /// <param name="proxyGenerator">The current <see cref="CodeDomClientCodeGenerator"/>.</param>
        /// <param name="indentLevel">The indentation level for the code to write.</param>
        public NotificationMethodGenerator(CodeDomClientCodeGenerator proxyGenerator, IndentationLevel indentLevel)
        {
            this.proxyGenerator = proxyGenerator;
            this.isCSharp = proxyGenerator.IsCSharp;
            int level = (int)indentLevel;
            if (level < 0)
            {
                level = (int)DefaultIndentLevel;
            }

            while (level-- > 0)
            {
                this.indent += IndentString;
            }

            this.AddMethodFor("Created", Resource.CommentOnCreated); // add default partial method.
        }
コード例 #2
0
        public T AddChildPageControl <T>(T child, Position position) where T : PageControlBase
        {
            child.IndentationLevel = child.IndentationLevel ?? IndentationLevel.GetValueOrDefault(0) + 1;

            switch (position)
            {
            case Position.FirstWithinContainer:
                Container.Insert(Index + 1, child);
                break;

            case Position.LastWithinContainer:
                var descendantPageControls = Descendants;
                var lastIndex = descendantPageControls.Any() ? descendantPageControls.Last().Index : Index;
                Container.Insert(lastIndex + 1, child);
                break;
            }

            return(child);
        }
コード例 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NotificationMethodGenerator"/> class.
        /// </summary>
        /// <param name="proxyGenerator">The current <see cref="CodeDomClientCodeGenerator"/>.</param>
        /// <param name="indentLevel">The indentation level for the code to write.</param>
        public NotificationMethodGenerator(CodeDomClientCodeGenerator proxyGenerator, IndentationLevel indentLevel)
        {
            this.proxyGenerator = proxyGenerator;
            this.isCSharp       = proxyGenerator.IsCSharp;
            int level = (int)indentLevel;

            if (level < 0)
            {
                level = (int)DefaultIndentLevel;
            }

            while (level-- > 0)
            {
                this.indent += IndentString;
            }

            this.AddMethodFor("Created", Resource.CommentOnCreated); // add default partial method.
        }