示例#1
0
        // Constructor
        /// <summary>
        /// Open a profile (create if not exist) and load it.
        /// </summary>
        /// <param name="profileDirectory">The root directory of the profile</param>
        public CraftitudeProfile(DirectoryInfo profileDirectory)
        {
            Directory = profileDirectory;

            _craftitudeDirectory = Directory.CreateSubdirectory("craftitude");
            _craftitudeDirectory.CreateSubdirectory("repositories"); // repository package lists
            _craftitudeDirectory.CreateSubdirectory("packages"); // cached package setups

            _bsonFile = _craftitudeDirectory.GetFile("profile.bson");

            if (!_bsonFile.Exists)
            {
                ProfileInfo = new ProfileInfo();
            }
            else
            {
                using (FileStream bsonStream = _bsonFile.Open(FileMode.OpenOrCreate))
                {
                    using (var bsonReader = new BsonReader(bsonStream))
                    {
                        var jsonSerializer = new JsonSerializer();
                        ProfileInfo = jsonSerializer.Deserialize<ProfileInfo>(bsonReader) ?? new ProfileInfo();
                    }
                }
            }
        }
        internal override void Update(NotificationData data)
        {
            base.Update(data);

            //新しい通知を追加し、キープされた通知を再配置する
            var newDatas = ((SocialNotificationData)data).LogItems;
            var oldItemInfo = _actionLogs;
            var updatedDatas = (from nwItm in newDatas
                                join oldItm in oldItemInfo on nwItm.RawData equals oldItm.RawData into nwOldPair
                                from kpdItm in nwOldPair.DefaultIfEmpty()
                                select new { NewItemData = nwItm, OldItemInfo = kpdItm }).ToArray();
            foreach (var item in updatedDatas.Select((obj, idx) => new { Index = idx, Result = obj }))
                if (item.Result.OldItemInfo == null)
                    _actionLogs.Insert(item.Index, new NotificationItemInfo(item.Result.NewItemData, Client));
                else
                {
                    var oldIdx = 0;
                    if ((oldIdx = _actionLogs.IndexOf(item.Result.OldItemInfo)) >= 0 && item.Index != oldIdx)
                        _actionLogs.Move(oldIdx, item.Index);
                }
            //古い通知を削除
            for (var i = updatedDatas.Length; i < _actionLogs.Count; i++)
                _actionLogs.RemoveAt(i);

            if (Actor.Id != _actionLogs.First().Actor.Id)
                Actor = Client.People.InternalGetAndUpdateProfile(((SocialNotificationData)data).Actor);
        }
        public CecilSerializerContext(AssemblyDefinition assembly)
        {
            Assembly = assembly;
            SerializableTypesProfiles = new Dictionary<string, ProfileInfo>();
            SerializableTypes = new ProfileInfo();
            SerializableTypesProfiles.Add("Default", SerializableTypes);
            ComplexTypes = new Dictionary<TypeDefinition, SerializableTypeInfo>();

            SiliconStudioCoreAssembly = assembly.Name.Name == "SiliconStudio.Core"
                ? assembly
                : assembly.MainModule.AssemblyResolver.Resolve("SiliconStudio.Core");
        }
示例#4
0
        private void Auhtenticate(object state)
        {
            Thread.Sleep(500);
            if (_userId != _password)
                ProfileInfo = null;

            ProfileInfo = new ProfileInfo
            {
                FullName = "Fakhrul Azran Nawi",
                UserId = "fan2014"
            };

            CloseForm();
        }
示例#5
0
        public Application()
        {
            Applicant = new ProfileInfo();
            Agent = new ProfileInfo();
            RegistrationDate = DateTime.Now;
            StartDateTime = DateTime.Now;
            EndDateTime = DateTime.Now;
            EndUserTypeEnum = Data.EndUserTypeEnum.Residential;
            ProductTypeEnum = Data.ProductTypeEnum.Unifi;
            ApplicantTypeEnum = Data.ApplicantTypeEnum.Malaysian;
            ApplicationTypeEnum = Data.ApplicationTypeEnum.NewRegistration;
            Services = new List<Service>();
            ApplicationState = Data.ApplicationState.Incomplete;

            ApplicationId = DateTime.Now.ToString("yyMMddHHmmssnfmy xmnbzmz");
        }
        public void ChangeCurrentUserProfile(ProfileInfo profile)
        {
            var da = InstanceBuilder.CreateInstance<UserMaintenanceServiceDA>();
            UserInfoEntity userInfoEntity = da.GetUser(AppContext.Current.UserName);
            userInfoEntity.Title = profile.Title;
            userInfoEntity.Email = profile.Email;
            userInfoEntity.TelephoneNo = profile.TelephoneNo;
            userInfoEntity.FaxNo = profile.FaxNo;
            userInfoEntity.MobileNo = profile.MobileNo;
            userInfoEntity.PageNo = profile.PageNo;
            userInfoEntity.Office = profile.Office;

            InstanceBuilder.CreateInstance<UserMaintenanceServiceDA>().UpdateUserInfo(userInfoEntity,
               new List<DataFilterEntity>(),
               null);
        }
 public bool Update(ProfileInfo o)
 {
     var success = false;
     if (o != null)
     {
         //using (var scope = new TransactionScope())
         {
             var product = _unitOfWork.ProfileInfoRepo.GetByID(o.Id);
             if (product != null)
             {
                 //product = productEntity.ProductName;
                 _unitOfWork.ProfileInfoRepo.Update(product);
                 _unitOfWork.Save();
                // scope.Complete();
                 success = true;
             }
         }
     }
     return success;
 }
        public HiiP.Infrastructure.Interface.BusinessEntities.ProfileInfo GetCurrentUserProfile()
        {
            var da = InstanceBuilder.CreateInstance<UserMaintenanceServiceDA>();
            UserInfoEntity entity = da.GetUser(AppContext.Current.UserName);
            ProfileInfo profile = new ProfileInfo(
                entity.Title,
                entity.Email,
                entity.TelephoneNo,
                entity.FaxNo,
                entity.MobileNo,
                entity.PageNo,
                entity.Office);

            //Delegations
            profile.Branch = entity.Branch;
            profile.Unit = entity.Unit;
            profile.SubUnit = entity.SubUnit;

            profile.VersionNo = entity.VersionNo;

            return profile;
        }
示例#9
0
        /// <summary>
        /// Import the User From the Current Table Row
        /// </summary>
        /// <param name="row">
        /// The row with the User Information.
        /// </param>
        /// <param name="importCount">
        /// The import Count.
        /// </param>
        /// <returns>
        /// Returns the Imported User Count.
        /// </returns>
        private int ImportUser(DataRow row, int importCount)
        {
            // Also Check if the Email is unique and exists
            if (this.Get <IAspNetUsersHelper>().GetUserByEmail((string)row["Email"]) != null)
            {
                return(importCount);
            }

            var pass = PasswordGenerator.GeneratePassword(true, true, true, true, false, 16);

            // create empty profile just so they have one
            var userProfile = new ProfileInfo();

            // Add Profile Fields to User List Table.
            if (row.Table.Columns.Contains("RealName") && ((string)row["RealName"]).IsSet())
            {
                userProfile.RealName = (string)row["RealName"];
            }

            if (row.Table.Columns.Contains("Blog") && ((string)row["Blog"]).IsSet())
            {
                userProfile.Blog = (string)row["Blog"];
            }

            if (row.Table.Columns.Contains("Gender") && ((string)row["Gender"]).IsSet())
            {
                int.TryParse((string)row["Gender"], out var gender);

                userProfile.Gender = gender;
            }

            if (row.Table.Columns.Contains("Birthday") && ((string)row["Birthday"]).IsSet())
            {
                DateTime.TryParse((string)row["Birthday"], out var userBirthdate);

                if (userBirthdate > DateTimeHelper.SqlDbMinTime())
                {
                    userProfile.Birthday = userBirthdate;
                }
            }

            if (row.Table.Columns.Contains("GoogleId") && ((string)row["GoogleId"]).IsSet())
            {
                userProfile.GoogleId = (string)row["GoogleId"];
            }

            if (row.Table.Columns.Contains("Location") && ((string)row["Location"]).IsSet())
            {
                userProfile.Location = (string)row["Location"];
            }

            if (row.Table.Columns.Contains("Country") && ((string)row["Country"]).IsSet())
            {
                userProfile.Country = (string)row["Country"];
            }

            if (row.Table.Columns.Contains("Region") && ((string)row["Region"]).IsSet())
            {
                userProfile.Region = (string)row["Region"];
            }

            if (row.Table.Columns.Contains("City") && ((string)row["City"]).IsSet())
            {
                userProfile.City = (string)row["City"];
            }

            if (row.Table.Columns.Contains("Interests") && ((string)row["Interests"]).IsSet())
            {
                userProfile.Interests = (string)row["Interests"];
            }

            if (row.Table.Columns.Contains("Homepage") && ((string)row["Homepage"]).IsSet())
            {
                userProfile.Homepage = (string)row["Homepage"];
            }

            if (row.Table.Columns.Contains("Skype") && ((string)row["Skype"]).IsSet())
            {
                userProfile.Skype = (string)row["Skype"];
            }

            if (row.Table.Columns.Contains("ICQe") && ((string)row["ICQ"]).IsSet())
            {
                userProfile.ICQ = (string)row["ICQ"];
            }

            if (row.Table.Columns.Contains("XMPP") && ((string)row["XMPP"]).IsSet())
            {
                userProfile.XMPP = (string)row["XMPP"];
            }

            if (row.Table.Columns.Contains("Occupation") && ((string)row["Occupation"]).IsSet())
            {
                userProfile.Occupation = (string)row["Occupation"];
            }

            if (row.Table.Columns.Contains("Twitter") && ((string)row["Twitter"]).IsSet())
            {
                userProfile.Twitter = (string)row["Twitter"];
            }

            if (row.Table.Columns.Contains("TwitterId") && ((string)row["TwitterId"]).IsSet())
            {
                userProfile.TwitterId = (string)row["TwitterId"];
            }

            if (row.Table.Columns.Contains("Facebook") && ((string)row["Facebook"]).IsSet())
            {
                userProfile.Facebook = (string)row["Facebook"];
            }

            if (row.Table.Columns.Contains("FacebookId") && ((string)row["FacebookId"]).IsSet())
            {
                userProfile.FacebookId = (string)row["FacebookId"];
            }

            var user = new AspNetUsers
            {
                Id              = Guid.NewGuid().ToString(),
                ApplicationId   = this.PageContext.BoardSettings.ApplicationId,
                UserName        = (string)row["Name"],
                LoweredUserName = (string)row["Name"],
                Email           = (string)row["Email"],
                IsApproved      = true,

                Profile_Birthday          = userProfile.Birthday,
                Profile_Blog              = userProfile.Blog,
                Profile_Gender            = userProfile.Gender,
                Profile_GoogleId          = userProfile.GoogleId,
                Profile_GitHubId          = userProfile.GitHubId,
                Profile_Homepage          = userProfile.Homepage,
                Profile_ICQ               = userProfile.ICQ,
                Profile_Facebook          = userProfile.Facebook,
                Profile_FacebookId        = userProfile.FacebookId,
                Profile_Twitter           = userProfile.Twitter,
                Profile_TwitterId         = userProfile.TwitterId,
                Profile_Interests         = userProfile.Interests,
                Profile_Location          = userProfile.Location,
                Profile_Country           = userProfile.Country,
                Profile_Region            = userProfile.Region,
                Profile_City              = userProfile.City,
                Profile_Occupation        = userProfile.Occupation,
                Profile_RealName          = userProfile.RealName,
                Profile_Skype             = userProfile.Skype,
                Profile_XMPP              = userProfile.XMPP,
                Profile_LastSyncedWithDNN = userProfile.LastSyncedWithDNN
            };

            this.Get <IAspNetUsersHelper>().Create(user, pass);

            // setup initial roles (if any) for this user
            this.Get <IAspNetRolesHelper>().SetupUserRoles(this.PageContext.PageBoardID, user);

            // create the user in the YAF DB as well as sync roles...
            var userID = this.Get <IAspNetRolesHelper>().CreateForumUser(user, this.PageContext.PageBoardID);

            if (userID == null)
            {
                // something is seriously wrong here -- redirect to failure...
                return(importCount);
            }

            // send user register notification to the new users
            this.Get <ISendNotification>().SendRegistrationNotificationToUser(
                user, pass, "NOTIFICATION_ON_REGISTER");

            // save the time zone...
            var userId = this.Get <IAspNetUsersHelper>().GetUserIDFromProviderUserKey(user.Id);

            var timeZone = 0;

            if (row.Table.Columns.Contains("Timezone") && ((string)row["Timezone"]).IsSet())
            {
                int.TryParse((string)row["Timezone"], out timeZone);
            }

            var autoWatchTopicsEnabled = this.PageContext.BoardSettings.DefaultNotificationSetting
                                         == UserNotificationSetting.TopicsIPostToOrSubscribeTo;

            this.GetRepository <User>().Save(
                userId,
                this.PageContext.PageBoardID,
                row["Name"].ToString(),
                row.Table.Columns.Contains("DisplayName") ? row["DisplayName"].ToString() : null,
                row["Email"].ToString(),
                timeZone.ToString(),
                row.Table.Columns.Contains("LanguageFile") ? row["LanguageFile"].ToString() : null,
                row.Table.Columns.Contains("Culture") ? row["Culture"].ToString() : null,
                row.Table.Columns.Contains("ThemeFile") ? row["ThemeFile"].ToString() : null,
                false);

            // save the settings...
            this.GetRepository <User>().SaveNotification(
                userId,
                true,
                autoWatchTopicsEnabled,
                this.PageContext.BoardSettings.DefaultNotificationSetting.ToInt(),
                this.PageContext.BoardSettings.DefaultSendDigestEmail);

            importCount++;

            return(importCount);
        }
 private pxcmStatus QueryProfileINT(Int32 pidx, out ProfileInfo pinfo)
 {
     pinfo = new ProfileInfo();
     return(PXCMSpeechRecognition_QueryProfile(instance, pidx, pinfo));
 }
示例#11
0
                public ProfileInfo Clone()
                {
                    ProfileInfo clone = new ProfileInfo();
                    clone.Count = this.Count;
                    clone.Time = this.Time;
                    clone.TotalTime = this.TotalTime;

                    return clone;
                }
 /**
     @brief The function sets the working algorithm configurations. 
     @param[in] config		The algorithm configuration.
     @return PXCM_STATUS_NO_ERROR			Successful execution.
 */
 public pxcmStatus SetProfile(ProfileInfo pinfo)
 {
     return PXCMSpeechRecognition_SetProfile(instance, pinfo);
 }
	public void CopyTo(ProfileInfo[] array, int index) {}
        private Data.ProfileInfo ReadFromMyKad()
        {
            try
            {
                ProfileInfo = null;
                _photoImage = null;
                List<string> sList = new List<string>();
                byte[] fp1 = null;
                byte[] fp2 = null;
                Image img = null;
                var state = ReadMyKad(out sList, out fp1, out fp2, out img);

                if (state != FpReturn.Success)
                    throw new Exception("Failed to read MyKad");

                ProfileInfo = new ProfileInfo();
                _photoImage = img;
                foreach (string s in sList)
                {
                    if (s.StartsWith("JPN_IDNum"))
                    {
                        string[] ids = s.Split('=');
                        ProfileInfo.IcNo = ids[1];
                    }
                    else if (s.StartsWith("JPN_GMPCName"))
                    {
                        string[] ids = s.Split('=');
                        ProfileInfo.FullName = ids[1];
                    }
                    else if (s.StartsWith("JPN_Citizenship"))
                    {
                        string[] ids = s.Split('=');
                        ProfileInfo.Citizenship = ids[1];
                    }
                    else if (s.StartsWith("JPN_Gender"))
                    {
                        string[] ids = s.Split('=');
                        ProfileInfo.Gender = ids[1];
                    }
                    else if (s.StartsWith("JPN_Address1"))
                    {
                        string[] ids = s.Split('=');
                        ProfileInfo.Address1 = ids[1];
                    }
                    else if (s.StartsWith("JPN_Address2"))
                    {
                        string[] ids = s.Split('=');
                        ProfileInfo.Address2 = ids[1];
                    }
                    else if (s.StartsWith("JPN_Address3"))
                    {
                        string[] ids = s.Split('=');
                        ProfileInfo.Address3 = ids[1];
                    }
                    else if (s.StartsWith("JPN_Postcode"))
                    {
                        string[] ids = s.Split('=');
                        ProfileInfo.Postcode = ids[1];
                    }
                    else if (s.StartsWith("JPN_City"))
                    {
                        string[] ids = s.Split('=');
                        ProfileInfo.City = ids[1];
                    }
                    else if (s.StartsWith("JPN_State"))
                    {
                        string[] ids = s.Split('=');
                        ProfileInfo.State = ids[1];
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            //ProfileInfo = new ProfileInfo
            //{
            //    FullName = "Fakhrul Azran Bin Nawi",
            //    IcNo = "99999999-99-9999",
            //    //DateOfBirth = new DateTime(1975, 01, 01),
            //    Gender = "Male"
            //};

            return ProfileInfo;
        }
示例#15
0
        public static void CreateProcessAsUser(string username, string domain, string password, string commandLine)
        {
            IntPtr hToken = IntPtr.Zero;
            IntPtr hDupedToken = IntPtr.Zero;

            PROCESS_INFORMATION pi = new PROCESS_INFORMATION();

            try
            {
                bool result = LogonUser(username, domain, password, (int)LOGON32_LOGON_INTERACTIVE, (int)LOGON32_PROVIDER_DEFAULT, ref hToken);

                if (!result)
                {
                    throw new ApplicationException("LogonUser failed");
                }

                SECURITY_ATTRIBUTES sa = new SECURITY_ATTRIBUTES();
                sa.Length = Marshal.SizeOf(sa);

                result = DuplicateTokenEx(
                      hToken,
                      GENERIC_ALL_ACCESS,
                      ref sa,
                      (int)SECURITY_IMPERSONATION_LEVEL.SecurityIdentification,
                      (int)TOKEN_TYPE.TokenPrimary,
                      ref hDupedToken
                   );

                if (!result)
                {
                    throw new ApplicationException("DuplicateTokenEx failed");
                }

                STARTUPINFO si = new STARTUPINFO();
                si.cb = Marshal.SizeOf(si);
                si.lpDesktop = "winsta0\\default";

                ProfileInfo info = new ProfileInfo();
                info.dwSize = Marshal.SizeOf(info);
                info.lpUserName = username;
                info.dwFlags = 1;

                result = LoadUserProfile(hDupedToken, ref info);

                if (!result)
                {
                    int error = Marshal.GetLastWin32Error();

                    throw new System.ComponentModel.Win32Exception(error);
                }

                IntPtr lpEnvironment;

                result = CreateEnvironmentBlock(out lpEnvironment, hDupedToken, false);

                if (!result)
                {
                    int error = Marshal.GetLastWin32Error();

                    throw new System.ComponentModel.Win32Exception(error);
                }

                result = CreateProcessAsUser(
                                     hDupedToken,
                                     null,
                                     commandLine,
                                     ref sa, ref sa,
                                     false, 0x00000400, lpEnvironment,
                                     null, ref si, ref pi
                               );

                if (!result)
                {
                    int error = Marshal.GetLastWin32Error();

                    throw new System.ComponentModel.Win32Exception(error);
                }
            }
            finally
            {
                if (pi.hProcess != IntPtr.Zero)
                    CloseHandle(pi.hProcess);
                if (pi.hThread != IntPtr.Zero)
                    CloseHandle(pi.hThread);
                if (hDupedToken != IntPtr.Zero)
                    CloseHandle(hDupedToken);
            }
        }
示例#16
0
 public void AddToDict(int index, ProfileInfo pInfo)
 {
     profiles.Add(index, pInfo);
 }
示例#17
0
 public EventSystemRedirectProfileApplicationArgs(ApplicationViewManager.Name application, ProfileInfo profile)
 {
     Application = application;
     Profile     = profile;
 }
示例#18
0
        public ProfileViewModel(Action <ProfileViewModel> saveCommand, Action <ProfileViewModel> cancelHandler, List <string> groups, ProfileInfo profileInfo = null)
        {
            _saveCommand   = new RelayCommand(p => saveCommand(this));
            _cancelCommand = new RelayCommand(p => cancelHandler(this));

            _profileInfo = profileInfo ?? new ProfileInfo();

            Name = _profileInfo.Name;
            Host = _profileInfo.Host;

            if (CredentialManager.Loaded)
            {
                _credentials = CollectionViewSource.GetDefaultView(CredentialManager.CredentialInfoList);
            }
            else
            {
                ShowUnlockCredentialsHint = true;

                if (_profileInfo.CredentialID == -1)
                {
                    _credentials = new CollectionViewSource {
                        Source = new List <CredentialInfo>()
                    }
                }
示例#19
0
 public override string GetResult(ProfileInfo info)
 {
     return(info.MaxLikes.ToString());
 }
    /**
     *  @brief Return the configuration parameters of the SDK's TouchlessController application.
     *  @param[out] pinfo the profile info structure of the configuration parameters.
     *  @return PXC_STATUS_NO_ERROR if the parameters were returned successfully; otherwise, return one of the following errors:
     *  PXC_STATUS_ITEM_UNAVAILABLE - Item not found/not available.\n
     *  PXC_STATUS_DATA_NOT_INITIALIZED - Data failed to initialize.\n
     */


    public pxcmStatus QueryProfile(out ProfileInfo pinfo)
    {
        pinfo = new ProfileInfo();
        return(PXCMTouchlessController_QueryProfile(instance, pinfo));
    }
 internal static extern pxcmStatus PXCMTouchlessController_SetProfile(IntPtr instance, ProfileInfo pinfo);
示例#22
0
        // active polling is meh, should be replace by a simple notification server, but it's ok for now
        async Task PollLoop()
        {
            var profileInfo = (await ProfileManager.Current.GetProfileData(AccountId, ProfileDownloadType.ForceDownload, false)).ProfileInfo;

            if (profileInfo != null)
            {
                ProfileInfo = profileInfo;
            }

            await DownloadInboxRecords(AccountId);
            await QueryMissingProfiles();

            while (true)
            {
                try
                {
                    await DownloadFriends(false);

                    var save = false;
                    var lastAccountTransaction  = (await PreviousAccountTransaction.DownloadLastTransactionInfo(_client, ChainType.Data, ChainId, MessageServiceInfo.MessageDataChainIndex, AccountId))?.Item;
                    var lastReceiverTransaction = (await Receiver.DownloadLastTransactionInfo(_client, ChainType.Data, ChainId, MessageServiceInfo.MessageDataChainIndex, AccountId))?.Item;

                    if (_lastAccountTransaction == null)
                    {
                        _lastAccountTransaction = lastAccountTransaction;
                        save = true;
                    }
                    if (_lastReceivedTransaction == null)
                    {
                        _lastReceivedTransaction = lastReceiverTransaction;
                        save = true;
                    }

                    var result = new PollResult();
                    if (lastAccountTransaction != null)
                    {
                        if (lastAccountTransaction.TransactionId > _lastAccountTransaction.TransactionId)
                        {
                            var download = new AccountTransactionDownload(AccountId, ServiceNode.GetTransactionDownloadManager(MessageServiceInfo.MessageDataChainIndex))
                            {
                                MinimalTransactionId = Math.Max(1, _lastAccountTransaction.TransactionId)
                            };

                            if (await Poll(download, result))
                            {
                                _lastAccountTransaction = lastAccountTransaction;
                                save = true;
                            }
                        }
                    }

                    if (lastReceiverTransaction != null)
                    {
                        if (lastReceiverTransaction.TransactionId > _lastReceivedTransaction.TransactionId)
                        {
                            var download = new ReceiverTransactionDownload(AccountId, ServiceNode.GetTransactionDownloadManager(MessageServiceInfo.MessageDataChainIndex))
                            {
                                MinimalTransactionId = Math.Max(1, _lastReceivedTransaction.TransactionId)
                            };

                            if (await Poll(download, result))
                            {
                                _lastReceivedTransaction = lastReceiverTransaction;
                                save = true;
                            }
                        }
                    }

                    if (result.UpdateFriends)
                    {
                        await DownloadFriends(false);
                    }

                    foreach (var index in result.Indices)
                    {
                        var chat = GetChat(index, true);
                        if (!IsNodeChat(chat))
                        {
                            _chats[chat.Index] = chat;

                            GenerateSubmitAccount(index);
                            await GenerateDefaultExchangeKeys();
                        }

                        await chat.DownloadMessages(false);
                    }

                    if (result.Indices.Count > 0)
                    {
                        await UIApp.PubSub.PublishAsync(new MessageNodeRefreshEvent(this));
                    }

                    if (save)
                    {
                        await SaveAsync();
                    }


                    await Task.Delay(5000);
                }
                catch (Exception ex)
                {
                    Log.HandleException(ex);
                }
            }
        }
 private ProfileInfo GetSerializableTypes(string profile)
 {
     ProfileInfo profileInfo;
     if (!SerializableTypesProfiles.TryGetValue(profile, out profileInfo))
     {
         profileInfo = new ProfileInfo();
         SerializableTypesProfiles.Add(profile, profileInfo);
     }
     return profileInfo;
 }
示例#24
0
        public void SwitchTo(ProfileInfo profile)
        {
            var options = ToxOptions.Default;

            options.Ipv6Enabled = Config.Instance.EnableIpv6;

            if (Config.Instance.ProxyType != ToxProxyType.None)
            {
                options.UdpEnabled = false;
                options.ProxyType  = Config.Instance.ProxyType;
                options.ProxyHost  = Config.Instance.ProxyAddress;
                options.ProxyPort  = Config.Instance.ProxyPort;
            }
            else
            {
                options.UdpEnabled = Config.Instance.EnableUdp;
            }

            Tox newTox;

            if (profile != null)
            {
                var data = ToxData.FromDisk(profile.Path);
                if (data == null)
                {
                    throw new Exception("Could not load profile.");
                }

                if (data.IsEncrypted)
                {
                    throw new Exception("Data is encrypted, Toxy does not support encrypted profiles yet.");
                }

                newTox = new Tox(options, data);
            }
            else
            {
                newTox = new Tox(options);
            }

            var newToxAv = new ToxAv(newTox);

            InitManagers(newTox, newToxAv);

            if (Tox != null)
            {
                Tox.Dispose();
            }

            if (ToxAv != null)
            {
                ToxAv.Dispose();
            }

            Tox   = newTox;
            ToxAv = newToxAv;

            AvatarManager.Rehash();
            ConnectionManager.DoBootstrap();

            //TODO: move this someplace else and make it configurable
            if (string.IsNullOrEmpty(Tox.Name))
            {
                Tox.Name = "Tox User";
            }
            if (string.IsNullOrEmpty(Tox.StatusMessage))
            {
                Tox.StatusMessage = "Toxing on Toxy";
            }

            Tox.Start();
            ToxAv.Start();

            CurrentProfile = profile;
            MainWindow.Instance.Reload();
        }
	// Methods
	public void Add(ProfileInfo profileInfo) {}
示例#26
0
        public static RemoteDesktopSessionInfo CreateSessionInfo(ProfileInfo profileInfo = null)
        {
            if (profileInfo == null)
            {
                return(new RemoteDesktopSessionInfo());
            }

            var info = new RemoteDesktopSessionInfo
            {
                // Hostname
                Hostname = profileInfo.Host,

                // Display
                AdjustScreenAutomatically = profileInfo.RemoteDesktop_OverrideDisplay ? profileInfo.RemoteDesktop_AdjustScreenAutomatically : SettingsManager.Current.RemoteDesktop_AdjustScreenAutomatically,
                UseCurrentViewSize        = profileInfo.RemoteDesktop_OverrideDisplay ? profileInfo.RemoteDesktop_UseCurrentViewSize : SettingsManager.Current.RemoteDesktop_UseCurrentViewSize,
                DesktopWidth  = profileInfo.RemoteDesktop_OverrideDisplay ? (profileInfo.RemoteDesktop_UseCustomScreenSize ? profileInfo.RemoteDesktop_CustomScreenWidth : profileInfo.RemoteDesktop_ScreenWidth) : (SettingsManager.Current.RemoteDesktop_UseCustomScreenSize ? SettingsManager.Current.RemoteDesktop_CustomScreenWidth : SettingsManager.Current.RemoteDesktop_ScreenWidth),
                DesktopHeight = profileInfo.RemoteDesktop_OverrideDisplay ? (profileInfo.RemoteDesktop_UseCustomScreenSize ? profileInfo.RemoteDesktop_CustomScreenHeight : profileInfo.RemoteDesktop_ScreenHeight) : (SettingsManager.Current.RemoteDesktop_UseCustomScreenSize ? SettingsManager.Current.RemoteDesktop_CustomScreenHeight : SettingsManager.Current.RemoteDesktop_ScreenHeight),
                ColorDepth    = profileInfo.RemoteDesktop_OverrideColorDepth ? profileInfo.RemoteDesktop_ColorDepth : SettingsManager.Current.RemoteDesktop_ColorDepth,

                // Network
                Port = profileInfo.RemoteDesktop_OverridePort ? profileInfo.RemoteDesktop_Port : SettingsManager.Current.RemoteDesktop_Port,

                // Authentication
                EnableCredSspSupport = profileInfo.RemoteDesktop_OverrideCredSspSupport ? profileInfo.RemoteDesktop_EnableCredSspSupport : SettingsManager.Current.RemoteDesktop_EnableCredSspSupport,
                AuthenticationLevel  = profileInfo.RemoteDesktop_OverrideAuthenticationLevel ? profileInfo.RemoteDesktop_AuthenticationLevel : SettingsManager.Current.RemoteDesktop_AuthenticationLevel,

                // Remote audio
                AudioRedirectionMode        = profileInfo.RemoteDesktop_OverrideAudioRedirectionMode ? profileInfo.RemoteDesktop_AudioRedirectionMode : SettingsManager.Current.RemoteDesktop_AudioRedirectionMode,
                AudioCaptureRedirectionMode = profileInfo.RemoteDesktop_OverrideAudioCaptureRedirectionMode ? profileInfo.RemoteDesktop_AudioCaptureRedirectionMode : SettingsManager.Current.RemoteDesktop_AudioCaptureRedirectionMode,

                // Keyboard
                KeyboardHookMode = profileInfo.RemoteDesktop_OverrideApplyWindowsKeyCombinations ? profileInfo.RemoteDesktop_KeyboardHookMode : SettingsManager.Current.RemoteDesktop_KeyboardHookMode,

                // Local devices and resources
                RedirectClipboard  = profileInfo.RemoteDesktop_OverrideRedirectClipboard ? profileInfo.RemoteDesktop_RedirectClipboard : SettingsManager.Current.RemoteDesktop_RedirectClipboard,
                RedirectDevices    = profileInfo.RemoteDesktop_OverrideRedirectDevices ? profileInfo.RemoteDesktop_RedirectDevices : SettingsManager.Current.RemoteDesktop_RedirectDevices,
                RedirectDrives     = profileInfo.RemoteDesktop_OverrideRedirectDrives ? profileInfo.RemoteDesktop_RedirectDrives : SettingsManager.Current.RemoteDesktop_RedirectDrives,
                RedirectPorts      = profileInfo.RemoteDesktop_OverrideRedirectPorts ? profileInfo.RemoteDesktop_RedirectPorts : SettingsManager.Current.RemoteDesktop_RedirectPorts,
                RedirectSmartCards = profileInfo.RemoteDesktop_OverrideRedirectSmartcards ? profileInfo.RemoteDesktop_RedirectSmartCards : SettingsManager.Current.RemoteDesktop_RedirectSmartCards,
                RedirectPrinters   = profileInfo.RemoteDesktop_OverrideRedirectPrinters ? profileInfo.RemoteDesktop_RedirectPrinters : SettingsManager.Current.RemoteDesktop_RedirectPrinters,

                // Experience
                PersistentBitmapCaching           = profileInfo.RemoteDesktop_OverridePersistentBitmapCaching ? profileInfo.RemoteDesktop_PersistentBitmapCaching : SettingsManager.Current.RemoteDesktop_PersistentBitmapCaching,
                ReconnectIfTheConnectionIsDropped = profileInfo.RemoteDesktop_OverrideReconnectIfTheConnectionIsDropped ? profileInfo.RemoteDesktop_ReconnectIfTheConnectionIsDropped : SettingsManager.Current.RemoteDesktop_ReconnectIfTheConnectionIsDropped,

                // Performance
                NetworkConnectionType           = profileInfo.RemoteDesktop_OverrideNetworkConnectionType ? profileInfo.RemoteDesktop_NetworkConnectionType : SettingsManager.Current.RemoteDesktop_NetworkConnectionType,
                DesktopBackground               = profileInfo.RemoteDesktop_OverrideDesktopBackground ? profileInfo.RemoteDesktop_DesktopBackground : SettingsManager.Current.RemoteDesktop_DesktopBackground,
                FontSmoothing                   = profileInfo.RemoteDesktop_OverrideFontSmoothing ? profileInfo.RemoteDesktop_FontSmoothing : SettingsManager.Current.RemoteDesktop_FontSmoothing,
                DesktopComposition              = profileInfo.RemoteDesktop_OverrideDesktopComposition ? profileInfo.RemoteDesktop_DesktopComposition : SettingsManager.Current.RemoteDesktop_DesktopComposition,
                ShowWindowContentsWhileDragging = profileInfo.RemoteDesktop_OverrideShowWindowContentsWhileDragging ? profileInfo.RemoteDesktop_ShowWindowContentsWhileDragging : SettingsManager.Current.RemoteDesktop_ShowWindowContentsWhileDragging,
                MenuAndWindowAnimation          = profileInfo.RemoteDesktop_OverrideMenuAndWindowAnimation ? profileInfo.RemoteDesktop_MenuAndWindowAnimation : SettingsManager.Current.RemoteDesktop_MenuAndWindowAnimation,
                VisualStyles = profileInfo.RemoteDesktop_OverrideVisualStyles ? profileInfo.RemoteDesktop_VisualStyles : SettingsManager.Current.RemoteDesktop_VisualStyles
            };

            // Set credentials
            if (profileInfo.RemoteDesktop_UseCredentials)
            {
                info.CustomCredentials = true;

                info.Username = profileInfo.RemoteDesktop_Username;
                info.Password = profileInfo.RemoteDesktop_Password;
            }

            return(info);
        }
 public override ProfileInfoCollection GetAllProfiles(ProfileAuthenticationOption authenticationOption, int pageIndex, int pageSize, out int totalRecords)
 {
     ProfileInfoCollection profiles = new ProfileInfoCollection();
     foreach (FileInfo fi in this.ProfileFiles)
     {
         if (fi != null && fi.Exists == true)
         {
             ProfileInfo profile = new ProfileInfo(this.GetUsernameFromFile(fi.Name), false, fi.LastAccessTime, fi.LastWriteTime, GetProfileSize(fi));
             profiles.Add(profile);
         }
     }
     totalRecords = profiles.Count;
     return profiles;
 }
 public override string GetResult(ProfileInfo info)
 {
     return(info.GetUrlPhotoWithEmotion(EmotionsType.Sadness));
 }
 internal static extern pxcmStatus PXCMTouchlessController_SetProfile(IntPtr instance, ProfileInfo pinfo);
示例#30
0
 public static void Add(ProfileInfo o, string user)
 {
     Db.ProfileInfos.Add(o);
     Db.SaveChanges(user);
 }
 internal static extern pxcmStatus PXCMTouchlessController_QueryProfile(IntPtr instance, [Out] ProfileInfo pinfo);
示例#32
0
        //Update record
        public static void Update(ProfileInfo o, string user)
        {
            var result = from r in Db.ProfileInfos where r.Id == o.Id select r;

            Db.SaveChanges(user);
        }
 internal static extern pxcmStatus PXCMSpeechRecognition_QueryProfile(IntPtr voice, Int32 pidx, [Out] ProfileInfo pinfo);
    public ProfileInfoCollection FindProfilesByPropertyValue(SettingsProperty property, SearchOperator searchOperator, object value)
    {
        // instantiate an empty ProfileInfoCollection to use it for return
        ProfileInfoCollection pic = new ProfileInfoCollection();

        // try and open the connection and get the results
        try
        {
            // get the connection we're going to use
            using (SqlConnection conn = new SqlConnection(_connectionStringName))
            {

                // instantiate a SettingsPropertyValue from the property
                // to use it to serialize the value for comparison with the database
                SettingsPropertyValue spv = new SettingsPropertyValue(property);
                spv.PropertyValue = value;

                // set common parameters of the aspnet_Profile_FindProfiles stored procedure
                SqlCommand FindProfilesCommand = new SqlCommand("aspnet_Profile_FindProfiles", conn);
                FindProfilesCommand.CommandType = CommandType.StoredProcedure;
                FindProfilesCommand.CommandTimeout = _commandTimeout;
                FindProfilesCommand.Parameters.Add("@ApplicationName", System.Data.SqlDbType.NVarChar, 256).Value = base.ApplicationName;
                FindProfilesCommand.Parameters.Add("@PropertyName", System.Data.SqlDbType.NVarChar, 256).Value = property.Name;
                FindProfilesCommand.Parameters.Add("@OperatorType", System.Data.SqlDbType.Int).Value = (Int32)searchOperator;

                // if the serialized property value is of type string
                // carry on if the size is within allowed limits
                Boolean bTooBig = false;
                if (spv.SerializedValue is String)
                {
                    // if the serialized value is bigger than the PropertyValueString column's length
                    if (((String)spv.SerializedValue).Length > Int32.MaxValue)
                    {
                        bTooBig = true;
                    }
                    else
                    {
                        if (searchOperator == SearchOperator.Contains || searchOperator == SearchOperator.FreeText)
                        {
                            // if the searchOperator is a freetext operator then pass the value unaltered
                            FindProfilesCommand.Parameters.Add("@PropertyValueString",
                                System.Data.SqlDbType.NVarChar, Int32.MaxValue).Value = spv.PropertyValue;
                            FindProfilesCommand.Parameters.Add("@PropertyValueBinary",
                                System.Data.SqlDbType.VarBinary, Int32.MaxValue).Value = DBNull.Value;
                        }
                        else
                        {
                            // otherwise serialise the value before passing it
                            FindProfilesCommand.Parameters.Add("@PropertyValueString",
                                System.Data.SqlDbType.NVarChar, Int32.MaxValue).Value = spv.SerializedValue;
                            FindProfilesCommand.Parameters.Add("@PropertyValueBinary",
                                System.Data.SqlDbType.VarBinary, Int32.MaxValue).Value = DBNull.Value;
                        }

                        // set the parameter @PropertyType to indicate the property is a string
                        FindProfilesCommand.Parameters.Add("@PropertyType", System.Data.SqlDbType.Bit).Value = 0;
                    }
                }
                else
                {
                    if (((SqlBinary)spv.SerializedValue).Length > Int32.MaxValue)
                    {
                        bTooBig = true;
                    }
                    else
                    {
                        if (searchOperator == SearchOperator.Contains || searchOperator == SearchOperator.FreeText)
                        {
                            // if the searchOperator is a freetext operator then pass the value unaltered to the
                            // @PropertyValueString because we are passing a string anyway not a binary
                            FindProfilesCommand.Parameters.Add("@PropertyValueString",
                                System.Data.SqlDbType.NVarChar, Int32.MaxValue).Value = spv.PropertyValue;
                            FindProfilesCommand.Parameters.Add("@PropertyValueBinary",
                                System.Data.SqlDbType.VarBinary, Int32.MaxValue).Value = DBNull.Value;
                        }
                        else
                        {
                            // otherwise just serialise the value and pass it to the @PropertyBinaryValue
                            FindProfilesCommand.Parameters.Add("@PropertyValueString",
                                System.Data.SqlDbType.NVarChar, Int32.MaxValue).Value = DBNull.Value;
                            FindProfilesCommand.Parameters.Add("@PropertyValueBinary",
                                System.Data.SqlDbType.VarBinary, Int32.MaxValue).Value = spv.SerializedValue;
                        }

                        // set the parameter @PropertyType to indicate the property is a binary
                        FindProfilesCommand.Parameters.Add("@PropertyType", System.Data.SqlDbType.Bit).Value = 1;
                    }
                }

                if (bTooBig)
                {
                    // if the size is out of limits throw an exception
                    throw new ProviderException("Property value length is too big.");
                }

                // Open the database
                conn.Open();

                // Get a DataReader for the results we need
                using (SqlDataReader rdr = FindProfilesCommand.ExecuteReader(CommandBehavior.CloseConnection))
                {
                    while (rdr.Read())
                    {
                        // create a ProfileInfo with the data you got back from the current record of the SqlDataReader
                        ProfileInfo pi = new ProfileInfo(rdr.GetString(rdr.GetOrdinal("UserName")),
                            rdr.GetBoolean(rdr.GetOrdinal("IsAnonymous")),
                            DateTime.SpecifyKind(rdr.GetDateTime(rdr.GetOrdinal("LastActivityDate")), DateTimeKind.Utc),
                            DateTime.SpecifyKind(rdr.GetDateTime(rdr.GetOrdinal("LastUpdatedDate")), DateTimeKind.Utc), 0);

                        // add the ProfileInfo you just created to the ProfileInfoCollection that we will return
                        pic.Add(pi);
                    }
                }
            }
        }
        catch (Exception e)
        {
            // if anything went wrong, throw an exception
            throw new ProviderException("An error occured while finding profiles with your search criteria!", e);
        }

        return pic;
    }
 internal static extern pxcmStatus PXCMSpeechRecognition_SetProfile(IntPtr voice, ProfileInfo pinfo);
示例#36
0
        /// <summary>
        /// retrieve an user documents folder; also validates the user credentials to prevent unauthorized access to this folder
        /// </summary>
        /// <param name="userDomain"></param>
        /// <param name="userName"></param>
        /// <param name="userPassword"></param>
        /// <returns>documents directory</returns>
        public static string GetUserDocumentsFolder(
            string userDomain,
            string userName,
            string userPassword)
        {
            var token = IntPtr.Zero;

            try
            {
                // logon the user, domain (if defined) or local otherwise
                // myrtille must be running on a machine which is part of the domain for it to work
                if (LogonUser(userName, string.IsNullOrEmpty(userDomain) ? Environment.MachineName : userDomain, userPassword, string.IsNullOrEmpty(userDomain) ? (int)LogonType.LOGON32_LOGON_INTERACTIVE : (int)LogonType.LOGON32_LOGON_NETWORK, (int)LogonProvider.LOGON32_PROVIDER_DEFAULT, ref token))
                {
                    string serverName = null;
                    if (!string.IsNullOrEmpty(userDomain))
                    {
                        var context    = new DirectoryContext(DirectoryContextType.Domain, userDomain, userName, userPassword);
                        var controller = Domain.GetDomain(context).FindDomainController();
                        serverName = controller.Name;
                    }

                    IntPtr bufPtr;
                    if (NetUserGetInfo(serverName, userName, 4, out bufPtr) == NET_API_STATUS.NERR_Success)
                    {
                        var userInfo = new USER_INFO_4();
                        userInfo = (USER_INFO_4)Marshal.PtrToStructure(bufPtr, typeof(USER_INFO_4));

                        var profileInfo = new ProfileInfo
                        {
                            dwSize        = Marshal.SizeOf(typeof(ProfileInfo)),
                            dwFlags       = (int)ProfileInfoFlags.PI_NOUI,
                            lpServerName  = string.IsNullOrEmpty(userDomain) ? Environment.MachineName : serverName.Split(new[] { "." }, StringSplitOptions.None)[0],
                            lpUserName    = string.IsNullOrEmpty(userDomain) ? userName : string.Format(@"{0}\{1}", userDomain, userName),
                            lpProfilePath = userInfo.usri4_profile
                        };

                        // load the user profile (roaming if a domain is defined, local otherwise), in order to have it mounted into the registry hive (HKEY_CURRENT_USER)
                        // the user must have logged on at least once for windows to create its profile (this is forcibly done as myrtille requires an active remote session for the user to enable file transfer)
                        if (LoadUserProfile(token, ref profileInfo))
                        {
                            if (profileInfo.hProfile != IntPtr.Zero)
                            {
                                try
                                {
                                    // retrieve the user documents folder path, possibly redirected by a GPO to a network share (read/write accessible to domain users)
                                    // ensure the user doesn't have exclusive rights on it (otherwise myrtille won't be able to access it)
                                    IntPtr outPath;
                                    var    result = SHGetKnownFolderPath(KNOWNFOLDER_GUID_DOCUMENTS, (uint)KnownFolderFlags.DontVerify, token, out outPath);
                                    if (result == 0)
                                    {
                                        return(Marshal.PtrToStringUni(outPath));
                                    }
                                }
                                finally
                                {
                                    UnloadUserProfile(token, profileInfo.hProfile);
                                }
                            }
                        }
                    }
                }
                throw new Win32Exception(Marshal.GetLastWin32Error());
            }
            catch (Exception exc)
            {
                Trace.TraceError("Failed to retrieve user {0} documents folder ({1})", userName, exc);
                throw;
            }
            finally
            {
                if (token != IntPtr.Zero)
                {
                    CloseHandle(token);
                }
            }
        }
 private IEnumerator EndSoloLoop()
 {
     ProfileInfo.SelectedProfileInfo().SetSoloTime((int)(Time.time - m_startTime));
     RoundManager.DisablePlayersControl();
     yield return(null);
 }
        public static async void ShowCopyAsProfileDialog(IProfileManager viewModel, IDialogCoordinator dialogCoordinator, ProfileInfo selectedProfile)
        {
            var customDialog = new CustomDialog
            {
                Title = Localization.Resources.Strings.CopyProfile
            };

            var profileViewModel = new ProfileViewModel(async instance =>
            {
                await dialogCoordinator.HideMetroDialogAsync(viewModel, customDialog);
                viewModel.OnProfileDialogClose();

                AddProfile(instance);
            }, async instance =>
            {
                await dialogCoordinator.HideMetroDialogAsync(viewModel, customDialog);
                viewModel.OnProfileDialogClose();
            }, ProfileManager.GetGroups(), ProfileEditMode.Copy, selectedProfile);

            customDialog.Content = new ProfileDialog
            {
                DataContext = profileViewModel
            };

            viewModel.OnProfileDialogOpen();
            await dialogCoordinator.ShowMetroDialogAsync(viewModel, customDialog);
        }
示例#39
0
 /// <summary>
 /// 构造函数
 /// </summary>
 public YggdrasilInfo()
 {
     SelectedProfile   = new ProfileInfo();
     AvailableProfiles = new List <ProfileInfo>();
     User = new UserInfo();
 }
        public static async void ShowDeleteProfileDialog(IProfileManager viewModel, IDialogCoordinator dialogCoordinator, ProfileInfo selectedProfile)
        {
            var customDialog = new CustomDialog
            {
                Title = Localization.Resources.Strings.DeleteProfile
            };

            var confirmDeleteViewModel = new ConfirmDeleteViewModel(async instance =>
            {
                await dialogCoordinator.HideMetroDialogAsync(viewModel, customDialog);
                viewModel.OnProfileDialogClose();

                ProfileManager.RemoveProfile(selectedProfile);
            }, async instance =>
            {
                await dialogCoordinator.HideMetroDialogAsync(viewModel, customDialog);
                viewModel.OnProfileDialogClose();
            }, Localization.Resources.Strings.DeleteProfileMessage);

            customDialog.Content = new ConfirmDeleteDialog
            {
                DataContext = confirmDeleteViewModel
            };

            viewModel.OnProfileDialogOpen();
            await dialogCoordinator.ShowMetroDialogAsync(viewModel, customDialog);
        }
示例#41
0
 // Awake will get the scripts for the transforms that was specified in the Unity control panel
 void Awake()
 {
     this._AchScript   = transform.FindChild("AchievementBox").GetComponent <ProfileAchievement> ();
     this._BadgeScript = transform.FindChild("BadgeBox").GetComponent <ProfileBadge> ();
     this._InfScript   = transform.FindChild("ProfileInfo").GetComponent <ProfileInfo> ();
 }
        internal UserProfileModal GetProfileData(string uidNo, string rollNo)
        {
            UserProfileModal userProfileModal = new UserProfileModal();

            var genInfo = _dbConnection.GetModelDetails(RawSQL.GetProfileData(uidNo, rollNo)).AsEnumerable().FirstOrDefault();

            var branchInfo = _dbConnection.GetModelDetails(RawSQL.GetProfileBrInfo(Convert.ToDouble(rollNo))).AsEnumerable().FirstOrDefault();

            var sdfsd       = genInfo.Table;
            var profileData = new ProfileInfo()
            {
                Title         = genInfo?.Field <string>("Title"),
                FullName      = genInfo?.Field <string>("Name_Full"),
                DateOfBirth   = genInfo?.Field <DateTime?>("Date_Birth"),
                Gender        = genInfo?.Field <string>("Gender"),
                Caste         = genInfo?.Field <string>("Caste"),
                MaritalStatus = Convert.ToString(genInfo?.Field <Double?>("Marital_Status")) == "0" ? "Married"
                                : Convert.ToString(genInfo?.Field <Double?>("Marital_Status")) == "1" ? "Single"
                                : Convert.ToString(genInfo?.Field <Double?>("Marital_Status")) == "3" ? "Widowed"
                                : Convert.ToString(genInfo?.Field <Double?>("Marital_Status")) == "4" ? "Divorced"
                                : Convert.ToString(genInfo?.Field <Double?>("Marital_Status")) == "5" ? "Other"
                                : "Other",
                Nationality = genInfo?.Field <string>("Nationality") == "I" ? "Indian" : "Other",
                AadharNo    = genInfo.Field <string>("AadharNo"),
                PanNo       = genInfo.Field <string>("PanCardNo")
            };

            var contactData = new ContactInfo()
            {
                ResidenceAddr = genInfo?.Field <string>("Add1") +
                                genInfo?.Field <string>("Add2") +
                                genInfo?.Field <string>("Add3"),
                City               = genInfo?.Field <string>("City"),
                Pincode            = genInfo?.Field <string>("Pin_cd"),
                MobileNo1          = genInfo?.Field <string>("Mobile"),
                MobileNo2          = genInfo?.Field <string>("Mobile1"),
                EmergencyContact   = genInfo?.Field <string>("EmergencyContact"),
                EmergencyContactNo = genInfo?.Field <string>("EmergencyContactNo"),
                Email1             = genInfo?.Field <string>("Email1"),
                Email2             = genInfo?.Field <string>("Email2")
            };

            var occupationData = new CompanyInfo
            {
                OrgName     = genInfo?.Field <string>("Organization"),
                OrgAddress  = genInfo?.Field <string>("Place"),
                Designation = genInfo?.Field <string>("Designation"),
                Occupation  = genInfo?.Field <string>("Occupation"),
                OfficePh1   = genInfo?.Field <string>("Off_ph1"),
                OfficePh2   = genInfo?.Field <string>("Off_ph2")
            };

            var qualificationData = new QualificationInfo
            {
                Qualification = genInfo?.Field <string>("Qualification")
            };

            var personBrInfo = new PersonBrInfo
            {
                RollNo     = Convert.ToInt32(genInfo?.Field <Double?>("Roll_NO")),
                UidNo      = genInfo?.Field <string>("UID_No"),
                BrTitle    = genInfo?.Field <string>("Title_1"),
                GridCoord  = genInfo?.Field <string>("Grid_Coord"),
                DateOfIni1 = branchInfo?.Field <DateTime?>("DOI_1"),
                DateOfIni2 = branchInfo?.Field <DateTime?>("DOI_2")
            };

            userProfileModal.ProfileList       = profileData;
            userProfileModal.ContactInfo       = contactData;
            userProfileModal.CompanyInfo       = occupationData;
            userProfileModal.QualificationInfo = qualificationData;
            userProfileModal.PersonBrInfo      = personBrInfo;
            return(userProfileModal);
        }
示例#43
0
 public void AddTab(ProfileInfo profile)
 {
     _viewModel.AddTab(profile);
 }
 private static extern bool LoadUserProfile([In] System.IntPtr token, ref ProfileInfo profileInfo);
        private void button2_Click(object sender, EventArgs e)
        {
            btnVerify.Enabled = false;

            ProfileInfo = new ProfileInfo
            {
                FullName = "Ahmad Albab",
                IcNo = "1234556",
                Address1 = "Address 1",
                Address2 = "Asress 2",
                Address3 = "Adress 3",
                Citizenship = "MALAYSIA",
                City = "BANGI",
                Postcode = "12345",
                DateOfBirth = DateTime.Now,
                Gender = "M",
                State = "Selangor"
            };
            UpdateUI();

            btnVerify.Enabled = true;
        }
        /// <summary>
        /// Does the actual impersonation.
        /// </summary>
        /// <param name="userName">The name of the user to act as.</param>
        /// <param name="domain">The domain name of the user to act as.</param>
        /// <param name="password">The password of the user to act as.</param>
        /// <param name="loadUserProfile">if set to <c>true</c> [load user profile].</param>
        private void ImpersonateValidUser(string userName, string domain, string password, bool loadUserProfile)
        {
            this.profileHandle = IntPtr.Zero;
            this.userToken = IntPtr.Zero;

            WindowsIdentity tempWindowsIdentity = null;
            IntPtr token = IntPtr.Zero;

            ProfileInfo profileInfo = new ProfileInfo();

            profileInfo.Size = Marshal.SizeOf(profileInfo.GetType());
            profileInfo.Flags = 0x1;
            profileInfo.UserName = userName;

            profileInfo.ProfilePath = null;
            profileInfo.DefaultPath = null;

            profileInfo.PolicyPath = null;
            profileInfo.ServerName = domain;

            try
            {
                if (!RevertToSelf())
                {
                    throw new Win32Exception(Marshal.GetLastWin32Error());
                }

                if (LogonUser(userName, domain, password, Logon32LogonInteractive, Logon32ProviderDefault, ref token) == 0)
                {
                    throw new Win32Exception(Marshal.GetLastWin32Error());
                }

                if (DuplicateToken(token, 2, ref this.userToken) == 0)
                {
                    throw new Win32Exception(Marshal.GetLastWin32Error());
                }

                if (loadUserProfile && !LoadUserProfile(this.userToken, ref profileInfo))
                {
                    throw new Win32Exception(Marshal.GetLastWin32Error());
                }

                // Save the handle for dispose
                this.profileHandle = profileInfo.Profile;

                using (tempWindowsIdentity = new WindowsIdentity(this.userToken))
                {
                    this.impersonationContext = tempWindowsIdentity.Impersonate();
                }
            }
            finally
            {
                if (token != IntPtr.Zero)
                {
                    CloseHandle(token);
                }
            }
        }
示例#47
0
 public static extern bool LoadUserProfile(IntPtr hToken, ProfileInfo lpProfileInfo);
示例#48
0
 public void SetPlayerProfile(ProfileInfo profile)
 {
     PlayerNameInfo.text  = profile.playerName;
     PlayerLevelInfo.text = profile.playerLevel.ToString();
     PlayerGoldInfo.text  = profile.playerGold.ToString();
 }
 public override ProfileInfoCollection FindInactiveProfilesByUserName(ProfileAuthenticationOption authenticationOption, string usernameToMatch, DateTime userInactiveSinceDate, int pageIndex, int pageSize, out int totalRecords)
 {
     ProfileInfoCollection profiles = new ProfileInfoCollection();
     FileInfo fi = this.GetProfileFile(usernameToMatch);
     if (fi != null && fi.Exists == true && fi.LastAccessTime < userInactiveSinceDate)
     {
         ProfileInfo profile = new ProfileInfo(usernameToMatch, false, fi.LastAccessTime, fi.LastWriteTime, GetProfileSize(fi));
         profiles.Add(profile);
     }
     totalRecords = profiles.Count;
     return profiles;
 }
 /**
     @brief The function sets the current working algorithm configuration parameters.
     @param[in] pinfo		The configuration parameters.
     @return PXCM_STATUS_NO_ERROR				Successful execution.
 */
 public pxcmStatus SetProfile(ProfileInfo pinfo)
 {
     return PXCMSpeechSynthesis_SetProfile(instance, pinfo);
 }
 internal static extern pxcmStatus PXCMSpeechSynthesis_SetProfile(IntPtr tts, ProfileInfo pinfo);
 /**
     @brief The function returns the current working algorithm configuration parameters.
     @param[out] pinfo		The configuration parameters, to be returned.
     @return PXCM_STATUS_NO_ERROR				Successful execution.
 */
 public pxcmStatus QueryProfile(out ProfileInfo pinfo)
 {
     return QueryProfile(WORKING_PROFILE, out pinfo);
 }
        /** 
            @brief Return the configuration parameters of the SDK's TouchlessController application.
            @param[out] pinfo the profile info structure of the configuration parameters.
            @return PXC_STATUS_NO_ERROR if the parameters were returned successfully; otherwise, return one of the following errors:
            PXC_STATUS_ITEM_UNAVAILABLE - Item not found/not available.\n
            PXC_STATUS_DATA_NOT_INITIALIZED - Data failed to initialize.\n                        
        */


        public pxcmStatus QueryProfile(out ProfileInfo pinfo)
        {
            pinfo = new ProfileInfo();
            return PXCMTouchlessController_QueryProfile(instance, pinfo);
        }
示例#54
0
        /// <summary>
        /// Update user Profile Info.
        /// </summary>
        private void UpdateUserProfile()
        {
            var userProfile = new ProfileInfo
            {
                Country = this.Country.SelectedItem != null?this.Country.SelectedItem.Value.Trim() : string.Empty,
                              Region =
                                  this.Region.SelectedItem != null && this.Country.SelectedItem != null &&
                                  this.Country.SelectedItem.Value.Trim().IsSet()
                        ? this.Region.SelectedItem.Value.Trim()
                        : string.Empty,
                              City       = this.City.Text.Trim(),
                              Location   = this.Location.Text.Trim(),
                              Homepage   = this.HomePage.Text.Trim(),
                              ICQ        = this.ICQ.Text.Trim(),
                              Facebook   = this.Facebook.Text.Trim(),
                              Twitter    = this.Twitter.Text.Trim(),
                              XMPP       = this.Xmpp.Text.Trim(),
                              Skype      = this.Skype.Text.Trim(),
                              RealName   = this.Realname.Text.Trim(),
                              Occupation = this.Occupation.Text.Trim(),
                              Interests  = this.Interests.Text.Trim(),
                              Gender     = this.Gender.SelectedIndex,
                              Blog       = this.Weblog.Text.Trim()
            };

            DateTime userBirthdate;

            if (this.Get <BoardSettings>().UseFarsiCalender&& this.CurrentCultureInfo.IsFarsiCulture())
            {
                try
                {
                    var persianDate = new PersianDate(this.Birthday.Text);

                    userBirthdate = PersianDateConverter.ToGregorianDateTime(persianDate);
                }
                catch (Exception)
                {
                    userBirthdate = DateTimeHelper.SqlDbMinTime().Date;
                }

                if (userBirthdate >= DateTimeHelper.SqlDbMinTime().Date)
                {
                    userProfile.Birthday = userBirthdate.Date;
                }
            }
            else
            {
                DateTime.TryParse(this.Birthday.Text, this.CurrentCultureInfo, DateTimeStyles.None, out userBirthdate);

                if (userBirthdate >= DateTimeHelper.SqlDbMinTime().Date)
                {
                    // Attention! This is stored in profile in the user timezone date
                    userProfile.Birthday = userBirthdate.Date;
                }
            }

            this.User.Item2.Profile_Birthday          = userProfile.Birthday;
            this.User.Item2.Profile_Blog              = userProfile.Blog;
            this.User.Item2.Profile_Gender            = userProfile.Gender;
            this.User.Item2.Profile_GoogleId          = userProfile.GoogleId;
            this.User.Item2.Profile_GitHubId          = userProfile.GitHubId;
            this.User.Item2.Profile_Homepage          = userProfile.Homepage;
            this.User.Item2.Profile_ICQ               = userProfile.ICQ;
            this.User.Item2.Profile_Facebook          = userProfile.Facebook;
            this.User.Item2.Profile_FacebookId        = userProfile.FacebookId;
            this.User.Item2.Profile_Twitter           = userProfile.Twitter;
            this.User.Item2.Profile_TwitterId         = userProfile.TwitterId;
            this.User.Item2.Profile_Interests         = userProfile.Interests;
            this.User.Item2.Profile_Location          = userProfile.Location;
            this.User.Item2.Profile_Country           = userProfile.Country;
            this.User.Item2.Profile_Region            = userProfile.Region;
            this.User.Item2.Profile_City              = userProfile.City;
            this.User.Item2.Profile_Occupation        = userProfile.Occupation;
            this.User.Item2.Profile_RealName          = userProfile.RealName;
            this.User.Item2.Profile_Skype             = userProfile.Skype;
            this.User.Item2.Profile_XMPP              = userProfile.XMPP;
            this.User.Item2.Profile_LastSyncedWithDNN = userProfile.LastSyncedWithDNN;

            this.Get <IAspNetUsersHelper>().Update(this.User.Item2);
        }
 public static extern bool LoadUserProfile(
     [In] IntPtr hToken,
     ref ProfileInfo lpProfileInfo);
示例#56
0
 private static extern bool LoadUserProfile(IntPtr hToken, ref ProfileInfo lpProfileInfo);
 /**
     @brief The function returns the available algorithm configuration parameters.
     @param[in]	pidx		The zero-based index to retrieve all configuration parameters.
     @param[out] pinfo		The configuration parameters, to be returned.
     @return PXCM_STATUS_NO_ERROR				Successful execution.
     @return PXCM_STATUS_ITEM_UNAVAILABLE		No more configurations.
 */
 public pxcmStatus QueryProfile(Int32 pidx, out ProfileInfo pinfo)
 {
     return QueryProfileINT(instance, pidx, out pinfo);
 }
示例#58
0
 /// <summary>
 /// Index method
 /// </summary>
 /// <returns></returns>
 public ActionResult Index(ProfileInfo profileInfo)
 {
     return(View(profileInfo));
 }
 /** 
     @brief Set configuration parameters of the SDK TouchlessController application.
     @param[in] pinfo the profile info structure of the configuration parameters.
     @return PXC_STATUS_NO_ERROR if the parameters were set correctly; otherwise, return one of the following errors:
     PXC_STATUS_INIT_FAILED - Module failure during initialization.\n
     PXC_STATUS_DATA_NOT_INITIALIZED - Data failed to initialize.\n                        
 */
 public pxcmStatus SetProfile(ProfileInfo pinfo)
 {
     return PXCMTouchlessController_SetProfile(instance, pinfo);
 }
 private static extern bool LoadUserProfile([In] System.IntPtr token, ref ProfileInfo profileInfo);