/// <summary> /// 得到辅助类所表示 XmlNode 的属性值. /// </summary> /// <typeparam name="T">属性的类型.</typeparam> /// <param name="value">返回的属性值.</param> /// <param name="node">XmlNode 类.</param> /// <param name="name">属性名称.</param> /// <param name="defaultValue">属性默认值.</param> /// <returns>是否成功获取到 XmlNode 的属性.</returns> public static bool FetchAttributeValue <T> (ref T value, XmlNode node, string name, T defaultValue) #endif { if (null == node) { return(false); } if (string.IsNullOrEmpty(name)) { name = "value"; } XmlAttribute attribute = node.Attributes[name]; if (null != attribute) { try { value = StringConvert.ToObject <T> (attribute.Value); return(true); } catch { } } if (null == defaultValue) { value = default(T); } else { value = defaultValue; } return(false); }
public void RaisePostBackEvent(string eventArgument) { if (string.IsNullOrEmpty(eventArgument)) { return; } string[] parts = eventArgument.Split(';'); switch (parts[0]) { case "change": if (null != this.ChangeSync) { ProgressbarEventArgs e = new ProgressbarEventArgs(StringConvert.ToObject <int> (parts[1])); this.onChange(e); this.ChangeSync(this, e); } break; case "complete": if (null != this.CompleteSync) { ProgressbarEventArgs e = new ProgressbarEventArgs(StringConvert.ToObject <int> (parts[1])); this.onComplete(e); this.CompleteSync(this, e); } break; } }
public void RaisePostBackEvent(string eventArgument) { if (string.IsNullOrEmpty(eventArgument)) { return; } string[] parts = eventArgument.Split(';'); switch (parts[0]) { case "select": if (null != this.SelectSync) { TabsEventArgs e = new TabsEventArgs(StringConvert.ToObject <int> (parts[1])); this.onSelect(e); this.SelectSync(this, e); } break; } }