本文整理汇总了C#中IOrderedDictionary类的典型用法代码示例。如果您正苦于以下问题:C# IOrderedDictionary类的具体用法?C# IOrderedDictionary怎么用?C# IOrderedDictionary使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IOrderedDictionary类属于命名空间,在下文中一共展示了IOrderedDictionary类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExtractValues
protected override void ExtractValues(IOrderedDictionary dictionary) {
if (_valueExtrator != null) {
object value = _valueExtrator();
string stringValue = value as string;
dictionary[Column.Name] = (stringValue != null ? ConvertEditedValue(stringValue) : value);
}
}
示例2: FormViewUpdateEventArgs
internal FormViewUpdateEventArgs (object argument, IOrderedDictionary keys, IOrderedDictionary oldValues, IOrderedDictionary newValues)
: this (argument)
{
this.keys = keys;
this.oldValues = oldValues;
this.newValues = newValues;
}
示例3: ExtractValues
protected override void ExtractValues(IOrderedDictionary dictionary)
{
if (FileUploadEdit.HasFile)
{
var fileName = Guid.NewGuid() + Path.GetExtension(FileUploadEdit.FileName);
// try to upload the file showing error if it fails
try
{
Global.UploadFile(FileUploadEdit.FileBytes, fileName);
image_name.Value = fileName;
ImageEdit.ImageUrl = Global.Context.FileStorageUrl + fileName;
}
catch (Exception ex)
{
// display error
CustomValidator1.IsValid = false;
CustomValidator1.ErrorMessage = ex.Message;
image_name.Value = null;
}
}
dictionary[Column.Name] = image_name.Value;
}
示例4: ExtractValues
protected override void ExtractValues(IOrderedDictionary dictionary) {
string value = DropDownList1.SelectedValue;
if (value == String.Empty) {
value = null;
}
dictionary[Column.Name] = ConvertEditedValue(value);
}
示例5: GridViewUpdatedEventArgs
internal GridViewUpdatedEventArgs (int affectedRows, Exception e, IOrderedDictionary keys, IOrderedDictionary oldValues, IOrderedDictionary newValues)
: this (affectedRows, e)
{
this.keys = keys;
this.newValues = newValues;
this.oldValues = oldValues;
}
示例6: ExtractValuesFromCell
public override void ExtractValuesFromCell(IOrderedDictionary dictionary, DataControlFieldCell cell, DataControlRowState rowState, bool includeReadOnly)
{
Control control = null;
string dataField = this.DataField;
object obj2 = null;
if (cell.Controls.Count > 0)
{
control = cell.Controls[0];
CheckBox box = control as CheckBox;
if ((box != null) && (includeReadOnly || box.Enabled))
{
obj2 = box.Checked;
}
}
if (obj2 != null)
{
if (dictionary.Contains(dataField))
{
dictionary[dataField] = obj2;
}
else
{
dictionary.Add(dataField, obj2);
}
}
}
示例7: GridViewUpdateEventArgs
internal GridViewUpdateEventArgs (int rowIndex, IOrderedDictionary keys, IOrderedDictionary oldValues, IOrderedDictionary newValues)
{
this.rowIndex = rowIndex;
this.keys = keys;
this.newValues = newValues;
this.oldValues = oldValues;
}
示例8: DataEventArgs
public DataEventArgs(Int32 pageSize, Int32 startRowIndex, String sortExpression, IOrderedDictionary parameters)
{
this.PageSize = pageSize;
this.StartRowIndex = startRowIndex;
this.SortExpression = sortExpression;
this.Parameters = parameters;
}
示例9: DetailsViewUpdateEventArgs
internal DetailsViewUpdateEventArgs (object argument, IOrderedDictionary keys, IOrderedDictionary oldValues, IOrderedDictionary newValues)
{
this.argument = argument;
this.keys = keys;
this.newValues = newValues;
this.oldValues = oldValues;
}
示例10: SetFormViewParameters
public static void SetFormViewParameters(IOrderedDictionary parameters, object instance)
{
Type ObjType = instance.GetType();
foreach (DictionaryEntry parameter in parameters)
{
PropertyInfo property = ObjType.GetProperty(parameter.Key.ToString());
if (property != null)
{
Type t = property.PropertyType;
object value = null;
switch (t.Name)
{
case "Decimal":
if (!string.IsNullOrEmpty(parameter.Value.ToString()))
value = Convert.ToDecimal(parameter.Value);
else
value = Convert.ToDecimal(0.0);
break;
case "Boolean":
value = Convert.ToBoolean(parameter.Value);
break;
case "DateTime":
String DateTimeFormat = "dd/MM/yyyy";
DateTimeFormatInfo info = new DateTimeFormatInfo();
info.ShortDatePattern = DateTimeFormat;
String date = Convert.ToString(parameter.Value);
if (!String.IsNullOrEmpty(date) || date == "null")
value = Convert.ToDateTime(date,info);
break;
case "Double":
if (!string.IsNullOrEmpty(parameter.Value.ToString()))
value = Convert.ToDouble(parameter.Value);
else
value = 0.0;
break;
case "Int32":
value = Convert.ToInt32(parameter.Value);
break;
case "Single":
value = Convert.ToSingle(parameter.Value);
break;
case "String":
value = Convert.ToString(parameter.Value);
break;
case "Guid":
if (!string.IsNullOrEmpty(parameter.Value.ToString()))
value = new Guid("11111111111111111111111111111111");
break;
default:
break;
}
property.SetValue(instance, value, null);
}
}
parameters.Clear();
parameters.Add("Values", instance);
}
示例11: BindControl
/// <summary>
/// Binds a controls value to a property of an entity.
/// </summary>
/// <param name="formView">A <see cref="FormView"/> object.</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>
/// <param name="controlId">The id of the control to get the value from.</param>
public static void BindControl(FormView formView, IOrderedDictionary list, string propertyName, string controlId)
{
if (formView != null)
{
Control control = formView.FindControl(controlId);
BindControl(control, list, propertyName);
}
}
示例12: CopyTo
public static void CopyTo (this IOrderedDictionary from, IOrderedDictionary to)
{
if (to == null || from.Count == 0)
return;
foreach (DictionaryEntry de in from)
to.Add (de.Key, de.Value);
}
示例13: DataItemKey
public DataItemKey(IOrderedDictionary values) :
this()
{
foreach (string k in values.Keys)
{
Values.Add(k, values[k]);
}
}
示例14: ExtractValues
protected override void ExtractValues(IOrderedDictionary dictionary) {
// If it's an empty string, change it to null
string val = DropDownList1.SelectedValue;
if (val == String.Empty)
val = null;
ExtractForeignKey(dictionary, val);
}
示例15: ExtractValues
protected override void ExtractValues(IOrderedDictionary dictionary) {
// Es una cadena vacía, cámbiela a NULL
string value = DropDownList1.SelectedValue;
if (String.IsNullOrEmpty(value)) {
value = null;
}
ExtractForeignKey(dictionary, value);
}