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


C# IField.AddTypedProperty方法代码示例

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


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

示例1: AddChildProperties

        /// <summary>
        /// Adds any child properties that are linked to the field.
        /// </summary>
        /// <param name="child">The child whose properties are being added.</param>
        public override void AddChildProperties(IField child)
        {
            base.AddChildProperties(child);

            // Position the child within the grid.
            if (_positions.Columns != null)
            {
                Tuple<int, int> rowAndColumn = _positions.GetNextRowAndColumn();
                int column = rowAndColumn.Item2;
                int row = rowAndColumn.Item1;
                child.AddTypedProperty("Grid.Column", column);
                child.AddTypedProperty("Grid.Row", row);
                IList<IProperty> properties = child.Element.Properties.Find("Across");
                _positions.MakeItemUsed(row, column);
                if (properties != null && properties.Count > 0)
                {
                    IProperty across = properties[0];
                    if (across != null)
                    {
                        int columns = across.IntValue;
                        for (int i = 1; i < columns; ++i)
                            _positions.MakeItemUsed(row, column + i);
                        child.AddTypedProperty("Grid.ColumnSpan", columns);
                        if (properties.Count > 1)
                        {
                            int rows = properties[1].IntValue;
                            child.AddTypedProperty("Grid.RowSpan", rows);
                            for (int col = 0; col < columns; ++col)
                                for (int i = 0; i < rows; ++i)
                                    _positions.MakeItemUsed(row + i, column + col);
                        }
                    }
                }
            }
        }
开发者ID:MotorViper,项目名称:FormGenerator,代码行数:39,代码来源:Grid.cs


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