本文整理汇总了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);
}
}
}
}
}