A File which is part of the Aplication and is on the System
Наследование: FileBase
Пример #1
0
        /// <summary>
        ///     Gets the list of appfiles from
        /// </summary>
        /// <param name="file"></param>
        /// <returns></returns>
        public static IEnumerable <AppFile> GetAppFiles(string file)
        {
            if (string.IsNullOrEmpty(file))
            {
                throw new NullReferenceException();
            }
            var appfiles = new List <AppFile>();

            using (var reader = XmlReader.Create(file))
            {
                while (reader.Read())
                {
                    if (reader.IsStartElement())
                    {
                        if (reader.Name == "File")
                        {
                            var appfile = new AppFile(reader["SysPath"], Convert.ToDouble(reader["VersionID"]),
                                                      Convert.ToInt32(reader["FileID"]));
                            appfile.Name = reader["Name"];
                            appfiles.Add(appfile);
                        }
                    }
                }
            }
            return(appfiles);
        }
Пример #2
0
 /// <summary>
 ///     Gets the list of appfiles from
 /// </summary>
 /// <param name="file"></param>
 /// <returns></returns>
 public static IEnumerable<AppFile> GetAppFiles(string file)
 {
     if (string.IsNullOrEmpty(file))
         throw new NullReferenceException();
     var appfiles = new List<AppFile>();
     using (var reader = XmlReader.Create(file))
     {
         while (reader.Read())
         {
             if (reader.IsStartElement())
                 if (reader.Name == "File")
                 {
                     var appfile = new AppFile(reader["SysPath"], Convert.ToDouble(reader["VersionID"]),
                         Convert.ToInt32(reader["FileID"]));
                     appfile.Name = reader["Name"];
                     appfiles.Add(appfile);
                 }
         }
     }
     return appfiles;
 }