コード例 #1
0
		/// <summary>
		/// All installed provisioning profiles, sorted by newest first.
		/// </returns>
		public static IList<MobileProvision> GetAllInstalledProvisions (bool includeExpired)
		{
			
			if (!Directory.Exists (ProfileDirectory))
				return new MobileProvision[0];
			
			DateTime now = DateTime.Now;
			var list = new List<MobileProvision> ();
			var uuids = new HashSet<string> ();
			
			foreach (FilePath file in Directory.GetFiles (ProfileDirectory, "*.mobileprovision")) {
				var m = new MobileProvision ();
				try {
					m.Load (file);
					if (includeExpired || m.ExpirationDate > now)
						if (uuids.Add (m.Uuid))
							list.Add (m);
				} catch (Exception ex) {
					LoggingService.LogWarning ("Error reading iPhone mobile provision file '" + file +"'", ex);
				}
			}
			
			//newest first
			list.Sort ((x,y) => y.CreationDate.CompareTo (x.CreationDate));
			
			return list;
		}
コード例 #2
0
        /// <summary>
        /// All installed provisioning profiles, sorted by newest first.
        /// </returns>
        public static IList <MobileProvision> GetAllInstalledProvisions(bool includeExpired)
        {
            if (!Directory.Exists(ProfileDirectory))
            {
                return(new MobileProvision[0]);
            }

            DateTime now   = DateTime.Now;
            var      list  = new List <MobileProvision> ();
            var      uuids = new HashSet <string> ();

            foreach (FilePath file in Directory.GetFiles(ProfileDirectory, "*.mobileprovision"))
            {
                var m = new MobileProvision();
                try {
                    m.Load(file);
                    if (includeExpired || m.ExpirationDate > now)
                    {
                        if (uuids.Add(m.Uuid))
                        {
                            list.Add(m);
                        }
                    }
                } catch (Exception ex) {
                    LoggingService.LogWarning("Error reading iPhone mobile provision file '" + file + "'", ex);
                }
            }

            //newest first
            list.Sort((x, y) => y.CreationDate.CompareTo(x.CreationDate));

            return(list);
        }
コード例 #3
0
        public static MobileProvision LoadFromFile(string fileName)
        {
            var m = new MobileProvision();

            m.Load(fileName);
            return(m);
        }
コード例 #4
0
		public static MobileProvision LoadFromFile (string fileName)
		{
			var m = new MobileProvision ();
			m.Load (fileName);
			return m;
		}