本文整理汇总了C#中IOrderedDictionary.Remove方法的典型用法代码示例。如果您正苦于以下问题:C# IOrderedDictionary.Remove方法的具体用法?C# IOrderedDictionary.Remove怎么用?C# IOrderedDictionary.Remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOrderedDictionary
的用法示例。
在下文中一共展示了IOrderedDictionary.Remove方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BindControl
/// <summary>
/// Binds a controls value to a property of an entity.
/// </summary>
/// <param name="control">The control to get the value from.</param>
/// <param name="list">The <see cref="IOrderedDictionary"/> containing the values.</param>
/// <param name="propertyName">The name of the property to bind the value to.</param>
public static void BindControl(Control control, IOrderedDictionary list, String propertyName)
{
if (control != null)
{
if (list.Contains(propertyName))
{
list.Remove(propertyName);
}
list.Add(propertyName, GetValue(control));
}
}
示例2: SetValues
/// <summary>
/// Adds elements to the collection having the specified names and values.
/// </summary>
/// <param name="list">A collection of name/value pairs.</param>
/// <param name="names">The property names.</param>
/// <param name="values">The property values.</param>
public static void SetValues(IOrderedDictionary list, String[] names, Object[] values)
{
for ( int i = 0; i < names.Length; i++ )
{
if ( list.Contains(names[i]) )
{
list.Remove(names[i]);
}
list.Add(names[i], values[i]);
}
}
示例3: ExtractRowValues
protected virtual void ExtractRowValues (IOrderedDictionary fieldValues, GridViewRow row, bool includeReadOnlyFields, bool includePrimaryKey)
{
DataControlField field;
foreach (TableCell cell in row.Cells) {
DataControlFieldCell c = cell as DataControlFieldCell;
if (c == null)
continue;
field = c.ContainingField;
if (field != null && !field.Visible)
continue;
c.ContainingField.ExtractValuesFromCell (fieldValues, c, row.RowState, includeReadOnlyFields);
}
if (!includePrimaryKey && DataKeyNames != null)
foreach (string key in DataKeyNames)
fieldValues.Remove (key);
}
示例4: ExtractRowValues
protected virtual void ExtractRowValues (IOrderedDictionary fieldValues, bool includeReadOnlyFields, bool includePrimaryKey)
{
foreach (DetailsViewRow row in Rows) {
if (row.Cells.Count < 1) continue;
DataControlFieldCell c = row.Cells[row.Cells.Count-1] as DataControlFieldCell;
if (c != null)
c.ContainingField.ExtractValuesFromCell (fieldValues, c, row.RowState, includeReadOnlyFields);
}
if (!includePrimaryKey && DataKeyNames != null)
foreach (string key in DataKeyNames)
fieldValues.Remove (key);
}