本文整理汇总了C#中Status.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Status.Equals方法的具体用法?C# Status.Equals怎么用?C# Status.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Status
的用法示例。
在下文中一共展示了Status.Equals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Recalculate
internal void Recalculate()
{
var rows = grid.RowDefinitions.Count;
if (rows == 0)
rows = 1;
var columns = grid.ColumnDefinitions.Count;
if (columns == 0)
columns = 1;
var nChildren = grid.Children.Count;
var newStatus = new Status(rows, columns, nChildren);
if (newStatus.Equals(status))
return;
else
status = newStatus;
GridPositioning posAlgo = new GridPositioning(columns, rows);
for (int i = 0; i < nChildren; i++)
{
var child = (FrameworkElement)grid.Children[i];
GridPositioning.Position preset;
if (presetValues.ContainsKey(child))
preset = presetValues[child];
else
{
var c = child.ReadLocalValue(Grid.ColumnProperty);
var r = child.ReadLocalValue(Grid.RowProperty);
var cs = child.ReadLocalValue(Grid.ColumnSpanProperty);
var rs = child.ReadLocalValue(Grid.RowSpanProperty);
int? column = c.Equals(DependencyProperty.UnsetValue) ? null : (int?)(int)c;
int? row = r.Equals(DependencyProperty.UnsetValue) ? null : (int?)(int)r;
int columnSpan = cs.Equals(DependencyProperty.UnsetValue) ? 1 : (int)cs;
int rowSpan = rs.Equals(DependencyProperty.UnsetValue) ? 1 : (int)rs;
//HACK
//column = null;
//row = null;
//HACK
preset = new GridPositioning.Position() { X = column, Y = row, Width = columnSpan, Height = rowSpan };
presetValues[child] = preset;
}
var pos = posAlgo.Get(preset);
Grid.SetColumn((FrameworkElement)child, pos.X);
Grid.SetRow((FrameworkElement)child, pos.Y);
}
}