public BoardInfoCollection(SerializationInfo info, StreamingContext context) { BoardInfoCollection items = (BoardInfoCollection)info.GetValue("BoardInfoCollection", typeof(BoardInfoCollection)); AddRange(items); }
/// <summary> /// ServerChangeEventArgsクラスのインスタンスを初期化 /// </summary> /// <param name="old"></param> /// <param name="_new"></param> /// <param name="history"></param> public ServerChangeEventArgs(BoardInfo old, BoardInfo _new, BoardInfoCollection history) : this(old, _new) { // // TODO: コンストラクタ ロジックをここに追加してください。 // this.traceList = history; }
/// <summary> /// ServerChangeEventArgsクラスのインスタンスを初期化 /// </summary> /// <param name="old"></param> /// <param name="_new"></param> public ServerChangeEventArgs(BoardInfo old, BoardInfo _new) { // // TODO: コンストラクタ ロジックをここに追加してください。 // this.old = old; this._new = _new; this.traceList = null; }
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { if (value is string) { string[] array = value.ToString().Split(','); BoardInfoCollection collection = new BoardInfoCollection(); foreach (string item in array) { string[] info = item.Split('|'); if (info.Length == 3) { BoardInfo bi = new BoardInfo(info[1], info[2], info[0]); collection.Add(bi); } } return(collection); } return(base.ConvertFrom(context, culture, value)); }
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType == typeof(string)) { BoardInfoCollection src = (BoardInfoCollection)value; StringBuilder sb = new StringBuilder(); foreach (BoardInfo bi in src) { sb.AppendFormat("{0}|{1}|{2},", bi.Name, bi.Server, bi.Path); } if (sb.Length > 0) { sb.Remove(sb.Length - 1, 1); } return(sb.ToString()); } return(base.ConvertTo(context, culture, value, destinationType)); }
/// <summary> /// Categoryクラスのインスタンスを初期化 /// </summary> public Category() { this.children = new BoardInfoCollection(); this.isExpanded = false; this.name = String.Empty; }