/// <summary> /// Adds the contents of another <see cref="FastDFSConfigInfoCollection">FastDFSConfigInfoCollection</see> to the end of the collection. /// </summary> /// <param name="value">A <see cref="FastDFSConfigInfoCollection">FastDFSConfigInfoCollection</see> containing the Components to add to the collection. </param> public void AddRange(FastDFSConfigInfoCollection value) { for (int i = 0; (i < value.Count); i = (i + 1)) { this.Add((FastDFSConfigInfo)value.List[i]); } }
/// <summary> /// 测试保存FastDFS配置文件 /// </summary> public static void TestSaveFastDFSConfigInfo() { FastDFSConfigInfoCollection collections = new FastDFSConfigInfoCollection(); collections.Add(new FastDFSConfigInfo()); Serializer.Save(collections, @"F:\fastdfs.config"); }
/// <summary> /// 设置FastDFS对象信息 /// </summary> private static void SetFtpConfigInfo() { fastdfsList = (FastDFSConfigInfoCollection)Serializer.Load(typeof(FastDFSConfigInfoCollection), m_configfilepath); FastDFSConfigInfoCollection.FastDFSConfigInfoCollectionEnumerator fastdfss = fastdfsList.GetEnumerator(); //遍历集合并设置相应的FastDFS信息(静态)对象 while (fastdfss.MoveNext()) { if (fastdfss.Current.Default == 1 && fastdfss.Current.Enable == 1) { currentFtp = fastdfss.Current; break; } } }
/// <summary> /// Initializes a new instance of the <see cref="FastDFSConfigInfoCollection">FastDFSConfigInfoCollection</see> class containing the elements of the specified source collection. /// </summary> /// <param name="value">A <see cref="FastDFSConfigInfoCollection">FastDFSConfigInfoCollection</see> with which to initialize the collection.</param> public FastDFSConfigInfoCollection(FastDFSConfigInfoCollection value) { this.AddRange(value); }
/// <summary> /// Initializes a new instance of the <see cref="BaseConfigInfoCollectionEnumerator">BaseConfigInfoCollectionEnumerator</see> class referencing the specified <see cref="FastDFSConfigInfoCollection">FastDFSConfigInfoCollection</see> object. /// </summary> /// <param name="mappings">The <see cref="FastDFSConfigInfoCollection">FastDFSConfigInfoCollection</see> to enumerate.</param> public FastDFSConfigInfoCollectionEnumerator(FastDFSConfigInfoCollection mappings) { _temp = ((IEnumerable)(mappings)); _enumerator = _temp.GetEnumerator(); }