예제 #1
0
        internal Picture(BuddyClient client, AuthenticatedUser user, InternalModels.DataContract_PhotoList photo)
            : base(client, photo.FullPhotoURL, photo.ThumbnailPhotoURL, client.TryParseDouble(photo.Latitude),
            client.TryParseDouble(photo.Longitude), photo.PhotoComment, photo.ApplicationTag, photo.AddedDateTime,
            Int32.Parse(photo.PhotoID), user)
        {

        }
예제 #2
0
 internal PhotoAlbum (BuddyClient client, AuthenticatedUser user, int albumId)
     : base(client, user, null)
 {
     this.AlbumId = albumId;
     this.pictures = new List<Picture> ();
     this.Pictures = new ReadOnlyCollection<Picture> (this.pictures);
 }
예제 #3
0
 internal GameStates (BuddyClient client, User user)
     : base(client)
 {
     if (user == null)
         throw new ArgumentNullException ("user");
     this.User = user;
 }
예제 #4
0
 internal Locations(BuddyClient client, AuthenticatedUser user)
 {
     if (client == null) throw new ArgumentNullException("client");
     if (user == null) throw new ArgumentNullException("user");
     this.Client = client;
     this.User = user;
 }
예제 #5
0
        protected BuddyBase(BuddyClient client, AuthenticatedUser user):this(client)
        {
            if (user == null && AuthUserRequired) throw new ArgumentNullException("user");

            this.AuthUser = user;
            
        }
예제 #6
0
 internal MessageGroup (BuddyClient client, AuthenticatedUser user, int groupId, string name)
     : base(client, user)
 {
     if (client == null)
         throw new ArgumentNullException ("client");
     this.ID = groupId;
     this.Name = name;
 }
        internal PhotoAlbumPublic(BuddyClient client, int userId, string albumName): base(client)
        {

            this.AlbumName = albumName;
            this.UserId = userId;
            this.pictures = new List<PicturePublic>();
            this.Pictures = new ReadOnlyCollection<PicturePublic>(this.pictures);
        }
 internal PhotoAlbumPublic(BuddyClient client, AuthenticatedUser user, string albumName)
     : base(client, user)
 {
     this.AlbumName = albumName;
     this.UserId = user.ID;
     this.pictures = new List<PicturePublic>();
     this.Pictures = new ReadOnlyCollection<PicturePublic>(this.pictures);
 }
예제 #9
0
        internal Identity (BuddyClient client, string token)
            : base(client)
        {
            if (String.IsNullOrEmpty (token))
                throw new ArgumentException ("Can't be null or empty.", "token");

            this.Token = token;
        }
예제 #10
0
        internal Messages (BuddyClient client, AuthenticatedUser user)
            : base(client, user)
        {
            if (client == null)
                throw new ArgumentNullException ("client");

            this.Groups = new MessageGroups (client, user);

        }
예제 #11
0
        internal Notifications (BuddyClient client, AuthenticatedUser user)
            : base(client, user)
        {


            Android = new NotificationsAndroid (client, user);
            Apple = new NotificationsApple (client, user);
            Win8 = new NotificationsWin8 (client, user);
        }
예제 #12
0
        internal MetroArea(BuddyClient client, AuthenticatedUser user, InternalModels.DataContract_MetroList metro)
            : base(client, user)
        {


            this.MetroName = metro.MetroName;

            this.ImageURL = metro.ImageURL;
        }
예제 #13
0
        internal GroupMessage(BuddyClient client, InternalModels.DataContract_GroupMessage msg, MessageGroup group)
        {
            this.DateSent = Convert.ToDateTime(msg.SentDateTime, CultureInfo.InvariantCulture); 
            this.Group = group;

            this.Latitude = client.TryParseDouble(msg.Latitude);
            this.Longitude = client.TryParseDouble(msg.Longitude);

            this.FromUserID = Int32.Parse(msg.FromUserID);
            this.Text = msg.MessageText;
        }
예제 #14
0
 internal MessageGroup (BuddyClient client, AuthenticatedUser user, InternalModels.DataContract_GroupChatMemberships group)
     : base(client, user)
 {
     this.ID = Int32.Parse (group.ChatGroupID);
     this.Name = group.ChatGroupName;
     this.CreatedOn = Convert.ToDateTime (group.CreatedDateTime, CultureInfo.InvariantCulture);
     this.AppTag = group.ApplicationTag;
     this.OwnerUserID = Int32.Parse (group.OwnerUserID);
     this.MemberUserIDs = new List<int> ();
     foreach (string id in group.MemberUserIDList.Split(';'))
         this.MemberUserIDs.Add (Int32.Parse (id));
 }
예제 #15
0
 internal Blob(BuddyClient client, AuthenticatedUser user, InternalModels.DataContract_Blob blob) : base(client, user)
 {
     this.BlobID = long.Parse(blob.BlobID, CultureInfo.InvariantCulture);
     this.FriendlyName = blob.FriendlyName;
     this.MimeType = blob.MimeType;
     this.FileSize = int.Parse(blob.FileSize, CultureInfo.InvariantCulture);
     this.AppTag = blob.AppTag;
     this.Owner = long.Parse(blob.Owner, CultureInfo.InvariantCulture);
     this.Latitude = double.Parse(blob.Latitude, CultureInfo.InvariantCulture);
     this.Longitude = double.Parse(blob.Longitude, CultureInfo.InvariantCulture);
     this.UploadDate = blob.UploadDate;
     this.LastTouchDate = blob.LastTouchDate;
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            // Perform any additional setup after loading the view, typically from a nib.

            this.aiWorking.Hidden = true;
            this.lblPingResult.Hidden = true;

            if (BuddyApplicationName.StartsWith("[")) {
                UIAlertView alert = new UIAlertView(
                    "Buddy Platform",
                    "Please go to dev.buddy.com to create an app account and get your Application Name and Application Password values to run this sample.",
                    null,
                    "OK"
                    );
                btnCheckServer.Hidden = true;
                lblPingResult.Hidden = false;
                lblPingResult.Text = "Need AppName/Password.";
                alert.Show();
                return;
            }

            // create our client and our handler code
            this._buddyClient = new BuddyClient(BuddyApplicationName, BuddyApplicationPassword);

            this.btnCheckServer.TouchUpInside += (sender, e) =>  {
                this.aiWorking.Hidden = false;
                this.lblPingResult.Text = "";
                var start = DateTime.Now;
                this._buddyClient.PingAsync()
                    .ContinueWith(r => {

                        this.aiWorking.Hidden = true;
                        var deltaInSeconds = DateTime.Now.Subtract(start).TotalSeconds;
                        if (r.Exception == null) {
                            this.lblPingResult.Text = String.Format("Complete! ({0:0.00}s)", deltaInSeconds);
                        }
                        else {
                            var ex = r.Exception.InnerException;
                            var buddyException = ex as BuddyServiceException;
                            this.lblPingResult.Text = String.Format("Error: {0}.", buddyException != null ? buddyException.Error : ex.Message);
                        }
                        this.lblPingResult.Hidden = false;

                    },
                    // make sure we call back on the same thread
                    System.Threading.Tasks.TaskContinuationOptions.ExecuteSynchronously
                    );
            };
        }
예제 #17
0
 internal Video(BuddyClient client, AuthenticatedUser user, InternalModels.DataContract_Video video) : base(client, user)
 { 
     this.VideoID = long.Parse(video.VideoID, CultureInfo.InvariantCulture);
     this.FriendlyName = video.FriendlyName;
     this.MimeType = video.MimeType;
     this.FileSize = int.Parse(video.FileSize, CultureInfo.InvariantCulture);
     this.AppTag = video.AppTag;
     this.Owner = long.Parse(video.Owner, CultureInfo.InvariantCulture);
     this.Latitude = double.Parse(video.Latitude, CultureInfo.InvariantCulture);
     this.Longitude = double.Parse(video.Longitude, CultureInfo.InvariantCulture);
     this.UploadDate = DateTime.Parse(video.UploadDate, CultureInfo.InvariantCulture);
     this.LastTouchDate = DateTime.Parse(video.LastTouchDate, CultureInfo.InvariantCulture);
     this.VideoUrl = video.VideoUrl;
 }
예제 #18
0
        internal VirtualAlbum(BuddyClient client, AuthenticatedUser user, InternalModels.DataContract_VirtualPhotoAlbumInformation info)
            : base(client, user)
        {
            this.pictures = new List<PicturePublic> ();
            this.Pictures = new ReadOnlyCollection<PicturePublic> (this.pictures);

            this.ID = Int32.Parse (info.VirtualAlbumID);
            this.ApplicationTag = info.ApplicationTag;
            this.CreatedOn = Convert.ToDateTime (info.CreatedDateTime, CultureInfo.InvariantCulture);
            this.LastUpdated = Convert.ToDateTime (info.LastUpdatedDateTime, CultureInfo.InvariantCulture);
            this.Name = info.PhotoAlbumName;
            this.OwnerUserId = Int32.Parse (info.UserID);
            this.ThumbnailUrl = info.PhotoAlbumThumbnail;
        }
예제 #19
0
        internal GamePlayer(BuddyClient client, AuthenticatedUser user, InternalModels.DataContract_GamePlayerInfo info)
        {
            if (client == null) throw new ArgumentNullException("client");
            if (user == null) throw new ArgumentNullException("user");
            if (info == null) throw new ArgumentNullException("info");

            this.UserID = user.ID;
            
            this.ApplicationTag = info.ApplicationTag;
            this.BoardName = info.PlayerBoardName;
            this.CreatedOn = Convert.ToDateTime(info.PlayerDate, CultureInfo.InvariantCulture);
            this.Latitude = client.TryParseDouble(info.PlayerLatitude);
            this.Longitude = client.TryParseDouble(info.PlayerLongitude);
            this.Name = info.PlayerName;
            this.Rank = info.PlayerRank;
        }
예제 #20
0
        internal StoreItem(BuddyClient client, AuthenticatedUser user, InternalModels.DataContract_CommerceStoreGetItems storeItem)
            : base(client, user)
        {

            this.AppData = storeItem.AppData;
            this.CustomItemID = storeItem.CustomItemID;
            this.StoreItemID = storeItem.StoreItemID;
            this.ItemAvailableFlag = storeItem.ItemAvailableFlag == "true";
            this.ItemCost = storeItem.ItemCost;
            this.ItemDateTime = DateTime.Parse(storeItem.ItemDateTime);
            this.ItemDescription = storeItem.ItemDescription;
            this.ItemDownloadUri = storeItem.ItemDownloadUri;
            this.ItemFreeFlag = storeItem.ItemFreeFlag == "true";
            this.ItemIconUri = storeItem.ItemIconUri;
            this.ItemName = storeItem.ItemName;
            this.ItemPreviewUri = this.ItemPreviewUri;
        }
예제 #21
0
        internal Receipt(BuddyClient client, AuthenticatedUser user, InternalModels.DataContract_CommerceReceipt receipt)
            : base(client, user)
        {


            this.AppData = receipt.AppData;
            this.HistoryCustomTransactionID = receipt.HistoryCustomTransactionID;
            this.HistoryDateTime = DateTime.Parse(receipt.HistoryDateTime);
            this.ItemQuantity = int.Parse(receipt.ItemQuantity);
            this.ReceiptData = receipt.ReceiptData;
            this.ReceiptHistoryID = long.Parse(receipt.ReceiptHistoryID);
            this.StoreItemID = long.Parse(receipt.StoreItemID);
            this.StoreName = receipt.StoreName;
            this.TotalCost = receipt.TotalCost;
            this.UserID = long.Parse(receipt.UserID);
            this.VerificationResultData = !string.IsNullOrEmpty(receipt.VerificationResult) && bool.Parse(receipt.VerificationResult) ? this.VerificationResultData : "";
        }
예제 #22
0
        // Constructor
        public MainPage()
        {
            InitializeComponent();

            // Set the data context of the listbox control to the sample data
            DataContext = App.ViewModel;
            this.Loaded += new RoutedEventHandler(MainPage_Loaded);
            if (NetworkInterface.GetIsNetworkAvailable())
            {
                budClient = new BuddyClient("Binary", "41124078-4C45-4FD0-B63A-BC3E80062F67");
                speechkitInitialize();
                App.CancelSpeechKit += new CancelSpeechKitEventHandler(App_CancelSpeechKit);
            }
            else
            {
                spTile.IsEnabled = false;
                dictate.IsEnabled = false;
                MessageBox.Show("Whoa how archaic, I couldnt seem to find an internet connection. Unfortunatly services like my messaging and speech features require internet so they wont work till you turn it back on.");
            }
        }
        internal NotificationsApple (BuddyClient client, AuthenticatedUser user)
            : base(client, user)
        {

        }
예제 #24
0
 public Blobs(BuddyClient client, AuthenticatedUser user)
     : base(client, user) { }
예제 #25
0
        internal ApplicationStatistics(InternalModels.DataContract_ApplicationStats appStats, BuddyClient client)
        {
            if (client == null)
                throw new ArgumentNullException("client");

            this.TotalUsers = appStats.TotalUsers;

            this.TotalDeviceInformation = appStats.TotalDeviceInformation;

            this.TotalCrashes = appStats.TotalCrashes;

            this.TotalAppMetadata = appStats.TotalAppMetadata;

            this.TotalAlbums = appStats.TotalAlbums;

            this.TotalFriends = appStats.TotalFriends;

            this.TotalGamePlayers = appStats.TotalGamePlayers;

            this.TotalGameScores = appStats.TotalGameScores;

            this.TotalMessages = appStats.TotalMessages;

            this.TotalPhotos = appStats.TotalPhotos;

            this.TotalPushMessages = appStats.TotalPushMessages;

            this.TotalUserCheckins = appStats.TotalUserCheckins;

            this.TotalUserMetadata = appStats.TotalUserMetadata;
        }
예제 #26
0
        internal VirtualAlbums (BuddyClient client, AuthenticatedUser user)
            : base(client, user)
        {

        }
예제 #27
0
        internal GameScores (BuddyClient client, AuthenticatedUser authUser, User user)
            : base(client, authUser)
        {
            this.User = user;

        }
예제 #28
0
        internal PicturePublic(BuddyClient client, string fullUrl, string thumbnailUrl, double latitude, double longitude, string comment, string appTag,
                       DateTime addedOn, int photoId, User user)
            : base(client, user as AuthenticatedUser)
        {
            this.FullUrl = fullUrl;
            this.ThumbnailUrl = thumbnailUrl;
            this.Latitude = latitude;
            this.Longitude = longitude;
            this.Comment = comment;
            this.AppTag = appTag;
            this.AddedOn = addedOn;
            this.PhotoID = photoId;
            this.User = user;

        }
예제 #29
0
        internal PicturePublic(BuddyClient client, InternalModels.DataContract_VirtualPhotoList photo)
            : base(client)
        {
            if (photo == null) throw new ArgumentNullException("photo");


            this.FullUrl = photo.FullPhotoURL;
            this.ThumbnailUrl = photo.ThumbnailPhotoURL;
            this.Latitude = this.Client.TryParseDouble(photo.Latitude);
            this.Longitude = this.Client.TryParseDouble(photo.Longitude);
            this.AddedOn = photo.AddedDateTime;
            this.AppTag = photo.ApplicationTag;
            this.PhotoID = Int32.Parse(photo.PhotoID);
            this.UserId = Int32.Parse(photo.UserID);

        }
예제 #30
0
        internal PicturePublic(BuddyClient client, User user, InternalModels.DataContract_PublicPhotoSearch photo, int userId)
            : base(client)
        {
            if (photo == null) throw new ArgumentNullException("photo");

            this.FullUrl = photo.FullPhotoURL;
            this.ThumbnailUrl = photo.ThumbnailPhotoURL;
            this.Latitude = this.Client.TryParseDouble(photo.Latitude);
            this.Longitude = this.Client.TryParseDouble(photo.Longitude);
            this.AddedOn = Convert.ToDateTime(photo.PhotoAdded, CultureInfo.InvariantCulture);
            this.AppTag = photo.ApplicationTag;
            this.PhotoID = Int32.Parse(photo.PhotoID);
            this.User = user;
            this.UserId = userId;

            this.DistanceInKilometers = client.TryParseDouble(photo.DistanceInKilometers);
            this.DistanceInMeters = client.TryParseDouble(photo.DistanceInMeters);
            this.DistanceInMiles = client.TryParseDouble(photo.DistanceInMiles);
            this.DistanceInYards = client.TryParseDouble(photo.DistanceInYards);
        }