public ProfileMenu(ProfileModel userProfile = null)
        {
            _friendProfile = true;
            InitializeComponent();
            _eventManager  = EventManager.Instance;
            _profileAccess = ProfileAccess.Instance;
            _profile       = userProfile;


            // get current user profile information from the web
            if (Profile.Instance.CurrentProfile == null)
            {
                Profile.Instance.CurrentProfile = _profileAccess.GetUserProfile();
            }

            // take current user profile if no profile is providen
            if (userProfile == null)
            {
                _profile       = Profile.Instance.CurrentProfile;
                _friendProfile = false;
            }
            SetupProfile();

            // Change Title
            MainWindow.Instance.SwitchTitle("Profile");
        }
        public void GetAllPublicUserInfoTest()
        {
            // get all public user profile
            var firstCount = ProfileAccess.GetAllPublicUserInfos().Count;

            //create new public user
            UserAccess.Register(DefaultUser.Username + "1", DefaultUser.Password);

            var secondCount = ProfileAccess.GetAllPublicUserInfos().Count;

            Assert.AreEqual(firstCount + 1, secondCount);

            // not access to private user profile
            var profile = ProfileAccess.GetUserProfile();

            profile.IsPrivate = true;
            ProfileAccess.UpdateUserProfile(profile);

            var thirdCount = ProfileAccess.GetAllPublicUserInfos().Count;

            Assert.AreEqual(firstCount, thirdCount);

            // Delete user
            UserAccess.DeleteUser();
        }
        public void SetTutorialFinishedEditorTest()
        {
            ProfileAccess.SetEditorTutorialVisibility(false);

            var profile = ProfileAccess.GetUserProfile();

            Assert.IsFalse(profile.ShowEditorTutorial);
        }
示例#4
0
        public void setProfile(Profile profile)
        {
            this.profile = profile;

            ProfileAccess db = new ProfileAccess();

            db.Update(profile);
        }
示例#5
0
        private Profile createProfile(string firstname, string lastname)
        {
            ProfileAccess db      = new ProfileAccess();
            Profile       profile = new Profile {
                Id = this.Id, LastName = lastname, FirstName = firstname
            };

            return(profile);
        }
示例#6
0
            public static IntPtr OpenColorProfile(
                ref Profile profile,
                ProfileAccess desiredAccess = ProfileAccess.Read,
                FileShareMode shareMode     = FileShareMode.Read,
                CreatationMode creationMode = CreatationMode.OpenExisting)
            {
                var hProfile = _OpenColorProfile(ref profile, desiredAccess, shareMode, creationMode);

                if (hProfile == IntPtr.Zero)
                {
                    throw new Win32Exception(Marshal.GetLastWin32Error());
                }
                return(hProfile);
            }
示例#7
0
        public ProfileEditMenu()
        {
            InitializeComponent();
            _eventManager  = EventManager.Instance;
            _profileAccess = ProfileAccess.Instance;
            _profile       = Profile.Instance;

            InitialiseVisual();

            // Daily
            DailyManager.AchieveDaily(EnumsModel.DailyType.UpdateProfile);

            // Change Title
            MainWindow.Instance.SwitchTitle("Édition Profile");
        }
        public void GetUserProfileTest()
        {
            try
            {
                var profile = ProfileAccess.GetUserProfile();

                if (string.IsNullOrWhiteSpace(profile?.AchievementsString) || string.IsNullOrWhiteSpace(profile.StatsString))
                {
                    Assert.Fail();
                }
            }
            catch (Exception e)
            {
                Assert.Fail(e.Message);
            }
        }
        protected AbstractTest()
        {
            // Set default User
            DefaultUser = new UserModel()
            {
                Username   = "******",
                Password   = "******",
                FacebookId = "asddpd0w001001e01iewiwm01mwx0w1e"
            };

            // Set UserAccess endpoint
            UserAccess        = new UserAccess(Endpoint);
            ProfileAccess     = new ProfileAccess(Endpoint);
            FriendAccess      = new FriendAccess(Endpoint);
            GameAccess        = new GameAccess(Endpoint);
            ZoneAccess        = new ZoneAccess(Endpoint);
            PingAccess        = new PingAccess(Endpoint);
            LeaderboardAccess = new LeaderboardAccess(Endpoint);
            DailyAccess       = new DailyAccess(Endpoint);


            SessionEventWebsocketAccess.Initialize(WsSessionEventEndpoint);
        }
        public void ModifyUserProfileTest()
        {
            try
            {
                // get profile
                var description = "New Description";
                var profile     = ProfileAccess.GetUserProfile();

                // modify profile
                profile.Description = description;
                ProfileAccess.UpdateUserProfile(profile);

                // Check for modifications
                profile = ProfileAccess.GetUserProfile();
                if (profile.Description != description)
                {
                    Assert.Fail("Update failed on user profile");
                }
            }
            catch (Exception e)
            {
                Assert.Fail(e.Message);
            }
        }
        public void ListPublicuserMapsPrivateMapTest()
        {
            var firstCount = ZoneAccess.GetPublicZones().Count;

            // set private user
            var profile = ProfileAccess.GetUserProfile();

            // modify profile
            profile.IsPrivate = true;
            ProfileAccess.UpdateUserProfile(profile);

            // create map
            var mapHashId = ZoneAccess.CreateMap(DefaultZone.Name, DefaultZone.Content, DefaultZone.Level);

            //create new public user
            try
            {
                UserToken.Token = UserAccess.Register(DefaultUser.Username + "1", DefaultUser.Password);
            }
            catch
            {
                UserToken.Token = UserAccess.Login(DefaultUser.Username + "1", DefaultUser.Password);
            }

            var zones = ZoneAccess.GetPublicZones();

            Assert.AreEqual(firstCount, zones.Count);

            // delete new user
            UserAccess.DeleteUser();


            // Delete Map
            UserToken.Token = Token;
            ZoneAccess.DeleteMap(mapHashId);
        }
示例#12
0
        public async Task <bool> GetProfileAccess(int profileId, int doorId)
        {
            ProfileAccess dbProfileAccess = await _profileAccessRepository.GetProfileAccess(profileId, doorId);

            return(dbProfileAccess != null ? dbProfileAccess.EntryAccess : false);
        }
示例#13
0
 private static extern IntPtr _OpenColorProfile(
     [In] ref Profile pProfile,
     [In] ProfileAccess dwDesiredAccess,
     [In] FileShareMode dwShareMode,
     [In] CreatationMode dwCreationMode);
示例#14
0
 public ProfileManager(ProfileAccess profileAccess, DocumentAccess documentAccess)
 {
     _profileAccess  = profileAccess;
     _documentAccess = documentAccess;
 }