Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 internal User(BuddyClient client, int id)
     : base(client)
 {
     this.ID         = id;
     this.GameScores = new GameScores(this.Client, null, this);
     this.GameStates = new GameStates(this.Client, this);
 }
Esempio n. 3
0
        internal MetroArea(BuddyClient client, AuthenticatedUser user, InternalModels.DataContract_MetroList metro)
            : base(client, user)
        {
            this.MetroName = metro.MetroName;

            this.ImageURL = metro.ImageURL;
        }
Esempio n. 4
0
 internal Startup(BuddyClient client, AuthenticatedUser user, InternalModels.DataContract_SearchStartups startup)
     : base(client, user)
 {
     this.CenterLat            = decimal.Parse(startup.CenterLat, CultureInfo.InvariantCulture);
     this.CenterLong           = decimal.Parse(startup.CenterLong, CultureInfo.InvariantCulture);
     this.City                 = startup.City;
     this.CrunchBaseUrl        = startup.CrunchBaseUrl;
     this.CustomData           = startup.CustomData;
     this.DistanceInKilometers = string.IsNullOrEmpty(startup.DistanceInKilometers) ? 0 : double.Parse(startup.DistanceInKilometers, CultureInfo.InvariantCulture);
     this.DistanceInMeters     = string.IsNullOrEmpty(startup.DistanceInMeters) ? 0 : double.Parse(startup.DistanceInMeters, CultureInfo.InvariantCulture);
     this.DistanceInMiles      = string.IsNullOrEmpty(startup.DistanceInMiles) ? 0 : double.Parse(startup.DistanceInMiles, CultureInfo.InvariantCulture);
     this.DistanceInYards      = string.IsNullOrEmpty(startup.DistanceInYards) ? 0 : double.Parse(startup.DistanceInYards, CultureInfo.InvariantCulture);
     this.EmployeeCount        = string.IsNullOrEmpty(startup.EmployeeCount) ? 0 : int.Parse(startup.EmployeeCount, CultureInfo.InvariantCulture);
     this.FacebookURL          = startup.FacebookURL;
     this.FundingSource        = startup.FundingSource;
     this.HomePageURL          = startup.HomePageURL;
     this.Industry             = startup.Industry;
     this.LinkedinURL          = startup.LinkedinURL;
     this.LogoURL              = startup.LogoURL;
     this.MetroLocation        = startup.MetroLocation;
     this.PhoneNumber          = startup.PhoneNumber;
     this.StartupID            = long.Parse(startup.StartupID);
     this.StartupName          = startup.StartupName;
     this.StreetAddress        = startup.StreetAddress;
     this.TotalFundingRaised   = string.IsNullOrEmpty(startup.TotalFundingRaised) ? 0 : decimal.Parse(startup.TotalFundingRaised, CultureInfo.InvariantCulture);
     this.TwitterURL           = startup.TwitterURL;
     this.ZipPostal            = double.Parse(startup.ZipPostal, CultureInfo.InvariantCulture);
 }
Esempio n. 5
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);
 }
Esempio n. 6
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;
        }
Esempio n. 7
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);
 }
Esempio n. 8
0
 internal Place(BuddyClient client, AuthenticatedUser user, InternalModels.DataContract_SearchPlaces place)
     : base(client, user)
 {
     this.Address              = place.Address;
     this.AppTagData           = place.AppTagData;
     this.CategoryID           = Int32.Parse(place.CategoryID);
     this.CategoryName         = place.CategoryName;
     this.City                 = place.City;
     this.CreatedDate          = Convert.ToDateTime(place.CreatedDate, CultureInfo.InvariantCulture);
     this.DistanceInKilometers = Double.Parse(place.DistanceInKilometers, CultureInfo.InvariantCulture);
     this.DistanceInMeters     = Double.Parse(place.DistanceInMeters, CultureInfo.InvariantCulture);
     this.DistanceInMiles      = Double.Parse(place.DistanceInMiles, CultureInfo.InvariantCulture);
     this.DistanceInYards      = Double.Parse(place.DistanceInYards, CultureInfo.InvariantCulture);
     this.Fax         = place.Fax;
     this.ID          = Int32.Parse(place.GeoID);
     this.Latitude    = Double.Parse(place.Latitude, CultureInfo.InvariantCulture);
     this.Longitude   = Double.Parse(place.Longitude, CultureInfo.InvariantCulture);
     this.Name        = place.Name;
     this.PostalState = place.PostalState;
     this.PostalZip   = place.PostalZip;
     this.Region      = place.Region;
     this.ShortID     = place.ShortID;
     this.Telephone   = place.Telephone;
     this.TouchedDate = Convert.ToDateTime(place.TouchedDate, CultureInfo.InvariantCulture);
     this.UserTagData = place.UserTagData;
     this.Website     = place.WebSite;
 }
Esempio n. 9
0
        private void InitializeView()
        {
            // Create the Facebook LogIn View with the needed Permissions
            // https://developers.facebook.com/ios/login-ui-control/
            var loginView = new FBLoginView()
            {
                Frame = new RectangleF(85, 0, 151, 43)
            };

            // Hook up to FetchedUserInfo event, so you know when
            // you have the user information available

            bool didFetchUserInfo = false;

            loginView.FetchedUserInfo += (sender, e) => {
                if (didFetchUserInfo)
                {
                    return;
                }
                didFetchUserInfo = true;

                Console.WriteLine("User is logged in ID=" + e.User.GetId() + ", User name is " + e.User.GetName());
                FacebookClient fb = new FacebookClient(FBSession.ActiveSession.AccessTokenData.AccessToken);
                fb.AppId     = PopPicConstants.AppId;
                fb.AppSecret = PopPicConstants.AppSecret;

                BuddyClient buddyClient = new BuddyClient(PopPicConstants.BuddyAppName, PopPicConstants.BuddyAppKey);
                buddyClient.SocialLoginAsync("Facebook", e.User.GetId(), FBSession.ActiveSession.AccessTokenData.AccessToken).ContinueWith(result => {
                    var authenticatedUser  = result.Result;
                    var repository         = new GameRepository(authenticatedUser, buddyClient, fb);
                    AppDelegate.Repository = repository;
                    InvokeOnMainThread(() => {
                        if (this.ReturnAfterLoading)
                        {
                            this.NavigationController.PopViewControllerAnimated(true);
                        }

                        if (this.RepositoryLoaded != null)
                        {
                            this.RepositoryLoaded(this, repository);
                        }
                    });
                });
            };

            // Clean user Picture and label when Logged Out
            loginView.ShowingLoggedOutUser += (sender, e) => {
            };

            Root = new RootElement("Log In")
            {
                new Section("Please Sign In")
                {
                    new UIViewElement("", loginView, false)
                    {
                        Flags = UIViewElement.CellFlags.DisableSelection | UIViewElement.CellFlags.Transparent,
                    }
                }
            };
        }
Esempio n. 10
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            // window = new UIWindow (UIScreen.MainScreen.Bounds);

            Forms.Init();

            FBSettings.DefaultAppID       = FacebookAppId;
            FBSettings.DefaultDisplayName = DisplayName;

            window = new UIWindow(UIScreen.MainScreen.Bounds);
            UIViewController initialController;

            // Try to open up the cached fb access token
            var accountStore      = AccountStore.Create();
            var savedBuddyAccount = accountStore.FindAccountsForService(PopPicConstants.BuddyAccountKey).LastOrDefault();

            if (savedBuddyAccount != null &&
                FBSession.OpenActiveSession(false) &&
                FBSession.ActiveSession.IsOpen)
            {
                var            buddyToken  = savedBuddyAccount.Properties [PopPicConstants.BuddyAccessTokenKey];
                BuddyClient    buddyClient = new BuddyClient(PopPicConstants.BuddyAppName, PopPicConstants.BuddyAppKey);
                FacebookClient fb          = new FacebookClient(FBSession.ActiveSession.AccessTokenData.AccessToken);
                fb.AppId     = PopPicConstants.AppId;
                fb.AppSecret = PopPicConstants.AppSecret;

                initialController = SplashScreenStoryboard.InstantiateViewController("SplashScreenViewController") as UIViewController;

                buddyClient.LoginAsync(buddyToken).ContinueWith(t => {
                    if (!t.IsFaulted)
                    {
                        var authenticatedUser  = t.Result;
                        var repository         = new GameRepository(authenticatedUser, buddyClient, fb);
                        AppDelegate.Repository = repository;

                        InvokeOnMainThread(() => {
                            var newController = Storyboard.InstantiateViewController("MyGamesTabBarController") as UIViewController;
                            newController.ModalTransitionStyle = UIModalTransitionStyle.FlipHorizontal;
                            initialController.PresentViewController(newController, true, null);
                        });
                    }
                    else
                    {
                        // TODO: error
                    }
                });
            }
            else
            {
                initialController = Storyboard.InstantiateViewController("MyGamesTabBarController") as UIViewController;
                // initialController = GameplayStoryboard.InstantiateViewController("GameplayViewController") as GameplayViewController;
            }


            window.RootViewController = initialController;
            window.MakeKeyAndVisible();

            return(true);
        }
Esempio n. 11
0
 internal MetadataItem(BuddyClient client, UserMetadata owner, AppMetadata ownerApp, string token, InternalModels.DataContract_SearchAppMetaData d, double originLatitude, double originLongitude)
     : this(client, owner, ownerApp, token, d.MetaKey, d.MetaValue, client.TryParseDouble(d.MetaLatitude), client.TryParseDouble(d.MetaLongitude), d.LastUpdateDate, null)
 {
     this.DistanceInKilometers = this.Client.TryParseDouble (d.DistanceInKilometers);
     this.DistanceInMeters = this.Client.TryParseDouble (d.DistanceInMeters);
     this.DistanceInMiles = this.Client.TryParseDouble (d.DistanceInMiles);
     this.DistanceInYards = this.Client.TryParseDouble (d.DistanceInYards);
 }
Esempio n. 12
0
 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);
 }
Esempio n. 13
0
        protected BuddyBase(BuddyClient client, AuthenticatedUser user) : this(client)
        {
            if (user == null && AuthUserRequired)
            {
                throw new ArgumentNullException("user");
            }

            this.AuthUser = user;
        }
Esempio n. 14
0
 internal GameStates(BuddyClient client, User user)
     : base(client)
 {
     if (user == null)
     {
         throw new ArgumentNullException("user");
     }
     this.User = user;
 }
Esempio n. 15
0
        protected BuddyBase(BuddyClient client)
        {
            if (client == null)
            {
                throw new ArgumentNullException("client");
            }

            this.Client = client;
        }
Esempio n. 16
0
        internal Messages (BuddyClient client, AuthenticatedUser user)
            : base(client, user)
        {
            if (client == null)
                throw new ArgumentNullException ("client");

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

        }
Esempio n. 17
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;
 }
Esempio n. 18
0
        internal UserMetadata(BuddyClient client, string token)
            : base(client)
        {
            if (string.IsNullOrEmpty(token))
            {
                throw new ArgumentException("Can't be null or empty.", "token");
            }

            this.Token = token;
        }
Esempio n. 19
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;
        }
Esempio n. 20
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;
 }
Esempio n. 21
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;
        }
Esempio n. 22
0
 internal User(BuddyClient client, InternalModels.DataContract_ApplicationUserProfile applicationUserProfile)
     : this(client, Int32.Parse(applicationUserProfile.UserID))
 {
     this.Name        = applicationUserProfile.UserName;
     this.ID          = Int32.Parse(applicationUserProfile.UserID);
     this.Gender      = (UserGender)Enum.Parse(typeof(UserGender), applicationUserProfile.UserGender, true);
     this.Latitude    = this.Client.TryParseDouble(applicationUserProfile.UserLatitude);
     this.Longitude   = this.Client.TryParseDouble(applicationUserProfile.UserLongitude);
     this.LastLoginOn = DateTime.Parse(applicationUserProfile.LastLoginDate, CultureInfo.InvariantCulture);
     this.InitializeProfilePicture(applicationUserProfile.ProfilePictureUrl);
     this.CreatedOn = DateTime.Parse(applicationUserProfile.CreatedDate, CultureInfo.InvariantCulture);
     this.Status    = (UserStatus)Int32.Parse(applicationUserProfile.StatusID);
     this.Age       = Int32.Parse(applicationUserProfile.Age);
 }
Esempio n. 23
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;
 }
Esempio n. 24
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));
     }
 }
Esempio n. 25
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;
 }
Esempio n. 26
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 : "";
 }
Esempio n. 27
0
 internal User(BuddyClient client, InternalModels.DataContract_FriendRequests publicProfile, int userId)
     : this(client, Int32.Parse(publicProfile.FriendID) == userId ? Int32.Parse(publicProfile.UserID) : Int32.Parse(publicProfile.FriendID))
 {
     this.ID             = int.Parse(publicProfile.FriendID);
     this.Name           = publicProfile.UserName;
     this.Gender         = (UserGender)Enum.Parse(typeof(UserGender), publicProfile.UserGender, true);
     this.ApplicationTag = publicProfile.UserApplicationTag;
     this.Latitude       = this.Client.TryParseDouble(publicProfile.UserLatitude);
     this.Longitude      = this.Client.TryParseDouble(publicProfile.UserLongitude);
     this.LastLoginOn    = publicProfile.LastLoginDate;
     this.InitializeProfilePicture(publicProfile.ProfilePictureUrl);
     this.CreatedOn = publicProfile.CreatedDate;
     this.Status    = (UserStatus)Int32.Parse(publicProfile.StatusID);
     this.Age       = Int32.Parse(publicProfile.Age);
 }
Esempio n. 28
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;
 }
Esempio n. 29
0
        internal MetadataItem (BuddyClient client, UserMetadata owner, AppMetadata ownerApp, string token, string key, string value, double latitude, double longitude, DateTime lastUpdateOn, string appTag)
            : base(client)
        {
            if (String.IsNullOrEmpty (key))
                throw new ArgumentException ("Can;t be null or empty.", "key");

            this.Key = key;
            this.Value = value;
            this.Latitude = latitude;
            this.Longitude = longitude;
            this.LastUpdateOn = lastUpdateOn;
            this.ApplicationTag = appTag;
            this.Token = token;
            this.Owner = owner;
            this.OwnerApp = ownerApp;
        }
Esempio n. 30
0
        public Principal()
        {
            InitializeComponent();
            BuddyClient = new BuddyClient(ServiceManager.Client.AppName, ServiceManager.Client.AppPassword);


            _timer.Interval = TimeSpan.FromSeconds(1);
            _timer.Tick    += Timer_Tick;

            _line = new MapPolyline();
            if ((bool)IsolatedStorageSettings.ApplicationSettings["LocationConsent"] == true)
            {
                //ServiceManager.User.GetCheckInsAsync(HandleCheckins);
                PintarMapa();
                _watcher.PositionChanged += Watcher_PositionChanged;
            }
        }