Exemple #1
0
 /// <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;
         }
     }
 }
Exemple #2
0
 /// <summary>
 /// Gets a value indicating whether the collection contains the specified <see cref="FastDFSConfigInfoCollection">FastDFSConfigInfoCollection</see>.
 /// </summary>
 /// <param name="value">The <see cref="FastDFSConfigInfoCollection">FastDFSConfigInfoCollection</see> to search for in the collection.</param>
 /// <returns><b>true</b> if the collection contains the specified object; otherwise, <b>false</b>.</returns>
 public bool Contains(FastDFSConfigInfo value)
 {
     return(this.List.Contains(value));
 }
Exemple #3
0
 public int Add(FastDFSConfigInfo value)
 {
     return(this.List.Add(value));
 }
Exemple #4
0
 public void Remove(FastDFSConfigInfo value)
 {
     List.Remove(value);
 }
Exemple #5
0
 public void Insert(int index, FastDFSConfigInfo value)
 {
     List.Insert(index, value);
 }
Exemple #6
0
 /// <summary>
 /// Gets the index in the collection of the specified <see cref="FastDFSConfigInfoCollection">FastDFSConfigInfoCollection</see>, if it exists in the collection.
 /// </summary>
 /// <param name="value">The <see cref="FastDFSConfigInfoCollection">FastDFSConfigInfoCollection</see> to locate in the collection.</param>
 /// <returns>The index in the collection of the specified object, if found; otherwise, -1.</returns>
 public int IndexOf(FastDFSConfigInfo value)
 {
     return(this.List.IndexOf(value));
 }
Exemple #7
0
        ///// <summary>
        ///// 获取配置类实例
        ///// </summary>
        ///// <returns></returns>
        //public static FastDFSConfigInfo GetConfig()
        //{
        //    return FastDFSConfigFileManager.LoadConfig();
        //}

        /// <summary>
        /// 保存配置类实例
        /// </summary>
        /// <param name="emailconfiginfo"></param>
        /// <returns></returns>
        public static bool SaveConfig(FastDFSConfigInfo fastdfsconfiginfo)
        {
            Serializer.Save(fastdfsconfiginfo, m_configfilepath);
            return(true);
        }