Exemplo n.º 1
0
        /// <summary>
        /// Profile Update
        /// </summary>
        /// <param name="userIdentifier"></param>
        public void ProfileUpdate(Guid userIdentifier, MobileOS os = MobileOS.Unknown)
        {
            string osName = null;

            switch (os)
            {
            case MobileOS.Android:
                osName = "Android";
                break;

            case MobileOS.Windows8:
                osName = "Windows 8.1";
                break;

            case MobileOS.Blackberry:
                osName = "Blackberry";
                break;

            case MobileOS.iOS:
                osName = "iPhone";
                break;

            case MobileOS.WindowsPhone:
                osName = "Windows Phone";
                break;
            }

            var text     = string.IsNullOrWhiteSpace(osName) ? "has updated their profile." : string.Format("has updated their profile from the {0} client.", osName);
            var activity = new Activity()
            {
                Type           = Reference.None,
                Text           = text,
                UserIdentifier = userIdentifier,
            };

            this.Save(activity);
        }
Exemplo n.º 2
0
 public MobileApplicationForJukebox(string name, MobileOS os) : base(name)
 {
     this.TypeOS = os;
 }
Exemplo n.º 3
0
 public MobileApplicationForRegedit(string name, MobileOS os) : base(name)
 {
     this.typeOS = os;
 }
 public MobilePhone(MobileManufacturer manufacturer, string model, Battery battery, Display display, MobileOS os) : this(manufacturer, model, display, battery)
 {
     this.OS    = os;
     this.OSSet = true;
 }
Exemplo n.º 5
0
        /// <summary>
        /// Save
        /// </summary>
        /// <param name="profile">Profile</param>
        /// <returns>Profile</returns>
        public Profile Save(Profile profile, bool publishActivity = true, string facebookAccessToken = null, MobileOS os = MobileOS.Unknown)
        {
            if (null == profile)
            {
                throw new ArgumentNullException("profile");
            }

            if (Guid.Empty == profile.Identifier)
            {
                throw new ArgumentException("Identifier");
            }

            var original = this.SearchSingle(profile.Identifier, null, profile.Identifier);

            var sp = new UserSaveProfile()
            {
                UserIdentifier      = profile.Identifier,
                Status              = profile.Status.TrimIfNotNull(),
                DisplayName         = profile.Name.TrimIfNotNull(),
                Email               = profile.Email.TrimIfNotNull(),
                Location            = profile.Location.TrimIfNotNull(),
                PrivacyLevel        = (byte?)profile.PrivacyLevel,
                Longitude           = profile.Longitude == 0 || profile.Latitude == 0? (double?)null : profile.Longitude,
                Latitude            = profile.Longitude == 0 || profile.Latitude == 0 ? (double?)null : profile.Latitude,
                SearchRadius        = profile.SearchRadius == 0 ? (int?)null : profile.SearchRadius,
                IpAddress           = profile.IpAddress.TrimIfNotNull(),
                FacebookAccessToken = facebookAccessToken.TrimIfNotNull(),
            };

            var data = sp.Execute().LoadObject <Profile>();

            if (publishActivity)
            {
                if (!string.IsNullOrWhiteSpace(profile.Status) &&
                    original.Status != data.Status)
                {
                    this.activityCore.StatusUpdate(data.Identifier, data.Status);
                }
                else
                {
                    this.activityCore.ProfileUpdate(data.Identifier, os);
                }
            }

            return(data);
        }
Exemplo n.º 6
0
 public MobileApp(string platform, string name, MobileOS typeOS) : base(platform, name)
 {
     this.typeOS = typeOS;
 }
Exemplo n.º 7
0
 public MobileDevice(string deviceName, MobileOS mobileOS, string installationId)
 {
     DeviceName     = deviceName;
     MobileOS       = mobileOS;
     InstallationId = installationId;
 }