当前位置: 首页>>代码示例>>C#>>正文


C# UserType类代码示例

本文整理汇总了C#中UserType的典型用法代码示例。如果您正苦于以下问题:C# UserType类的具体用法?C# UserType怎么用?C# UserType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UserType类属于命名空间,在下文中一共展示了UserType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IdentificationPacket

 /// <summary>
 /// Initializes a new instance of the <see cref="IdentificationPacket"/> class.
 /// </summary>
 /// <param name="UserNameOrServerName">Name of the user name or server.</param>
 /// <param name="VerificationKeyOrMOTD">The verification key or MOTD.</param>
 /// <param name="UserType">Type of the user.</param>
 /// <remarks></remarks>
 public IdentificationPacket(string UserNameOrServerName, string VerificationKeyOrMOTD, UserType UserType)
 {
     this.ProtocolVersion = 7;
     this.UserNameOrServerName = UserNameOrServerName;
     this.VerificationKeyOrMOTD = VerificationKeyOrMOTD;
     this.UserType = UserType;
 }
开发者ID:Gam3rK1d,项目名称:MCForge-Vanilla-1,代码行数:14,代码来源:IdentificationPacket.cs

示例2: GetUser

        /// <summary>
        /// The get user.
        /// </summary>
        /// <param name="userType">
        /// The user type.
        /// </param>
        /// <returns>
        /// The <see cref="User"/>.
        /// </returns>
        public static User GetUser(UserType userType)
        {
            switch (userType)
            {
                case UserType.Picker:
                {
                    return new Picker();
                }

                case UserType.Packer:
                {
                    return new Packer();
                }

                case UserType.Stocker:
                {
                    return new Stocker();
                }

                case UserType.Manager:
                {
                   return new Manager();
                }

                case UserType.Customer:
                {
                    return new Customer();
                }

                default:
                {
                    return null;
                }
            }
        }
开发者ID:shane7218,项目名称:zeus_dotnet,代码行数:44,代码来源:UserFactory.cs

示例3: User

 /// <summary>
 /// Creates a new user
 /// </summary>
 /// <param name="Name">The name of the user</param>
 /// <param name="Username">The user's username</param>
 /// <param name="Password">The user's password</param>
 /// <param name="Type">The type of the user</param>
 public User(string Name, string Username, string Password, UserType Type)
 {
     this.Name = Name;
     this.Password = Password;
     this.Username = Username;
     this.Type = Type;
 }
开发者ID:everix1992,项目名称:CIS544Project,代码行数:14,代码来源:User.cs

示例4: Delete

        public bool Delete(UserType userType, int userId)
        {
            ManagerLock.EnterReadLock();            // Read

            XElement userElement;

            try {
                if ((userElement = FindUser(userType, userId)) == null)
                    return false;
            }
            finally{
                ManagerLock.ExitReadLock();         // EO Read
            }

            ManagerLock.EnterWriteLock();           // Write

            try {
                userElement.Remove();

                // Save persistent
                Configs.Save(FileName);
                return true;
            }
            finally{
                ManagerLock.ExitWriteLock();       // EO Write
            }
        }
开发者ID:goncalod,项目名称:csharp,代码行数:27,代码来源:EmailConfigMngr.cs

示例5: Login

 //public Login(string loginName, string userName, string password, UserType userType, int[] sectionedGrades)
 //{
 //    this.loginName = loginName;
 //    this.userName = userName;
 //    this.password = password;
 //    this.userType = userType;
 //    this.sectionedGrades = sectionedGrades;
 //}
 public Login(XElement loginElement)
 {
     loginName = loginElement.Attribute("LoginName").Value;
     userName = loginElement.Element("UserName").Value;
     password = loginElement.Element("Password").Value;
     personName = loginElement.Element("PersonName").Value;
     userType = (UserType)Enum.Parse(typeof(UserType), loginElement.Element("UserType").Value);
     string[] gradesStringArray = loginElement.Element("SectionedGrades").Value.Split(',');
     this.sectionedGrades = new int[gradesStringArray.Length];
     for (int i = 0; i < gradesStringArray.Length; i++)
     {
         sectionedGrades[i] = int.Parse(gradesStringArray[i]);
     }
     if (loginElement.Descendants("NavigationInfo").Any())
     {
         XElement navigationInfoElement = loginElement.Element("NavigationInfo");
         string subjectName;
         foreach (XElement subjectInfoElement in navigationInfoElement.Elements())
         {
             subjectName = subjectInfoElement.Attribute("SubjectName").Value;
             foreach (XElement TaskInfoElement in subjectInfoElement.Elements())
             {
                 TaskInfoList.Add(new TaskInfo(TaskInfoElement, subjectName));
             }
         }
     }
 }
开发者ID:kirankumarb4u,项目名称:WinStoreCodedUI,代码行数:35,代码来源:Login.cs

示例6: ChangeConnectionUser

        public void ChangeConnectionUser(UserType type)
        {
            Connection.Close();

            switch (type)
            {
                case UserType.STORE_MANAGER:
                    LoginConnStr = @"server=" + Server + ";userid=Storemanager;password=sm!9876;database=ggsr";
                    break;
                case UserType.DEPT_MANAGER:
                    LoginConnStr = @"server=" + Server + ";userid=Deptmanager;password=dm!9876;database=ggsr";
                    break;
                case UserType.TEAM_MEMBER:
                    LoginConnStr = @"server=" + Server + ";userid=Teammember;password=tm!9876;database=ggsr";
                    break;
            }
            try
            {
                Connection = new MySqlConnection(LoginConnStr);
                Connection.Open();
            }
            catch (MySqlException ex)
            {
                MessageBox.Show("Error: " + ex.ToString());
                Connection.Close();
            }
        }
开发者ID:jamesd24,项目名称:GGSR,代码行数:27,代码来源:DataBaseManager.cs

示例7: Authorize

        /// <summary>
        /// Method that checks if the user is authenticated and authorized to execute the method based on the authorization token.
        /// If authorization is optional and the user is not yet authenticated, a new account is created for the user.
        /// </summary>
        /// <param name="allowedUserTypes">Array of authorized UserTypes.</param>
        public void Authorize(UserType[] allowedUserTypes)
        {
            // Get user info using the AuthorizationToken HTTP header
            OpenIDUserInfo userInfo = this.userManager.GetOpenIDUserInfo();

            // Only continue if user info was successfully retrieved from the Access token issuer
            if (userInfo != null)
            {
                // Try to match a user using the user info retrieved from the Access Token issuer
                User matchedUser = this.userManager.MatchUser(userInfo);

                // Set the property that indicates if the user is authenticated
                this.IsAuthenticated = (matchedUser != null);

                // Check if the user is authenticated
                if (this.IsAuthenticated)
                {
                    // The user is authenticated, set the property that indicates if the user is authorized to execute the method
                    this.IsAuthorized = (allowedUserTypes.Count() == 0 || allowedUserTypes.Contains(matchedUser.Type));
                }
                else
                {
                    // The user is not authenticated - check if authorization is optional or if a customer is authorized to execute the method
                    if (allowedUserTypes.Count() == 0 || allowedUserTypes.Contains(UserType.Customer))
                    {
                        // Authorization is optional or a customer is authorized to execute the method, create a new user using the user info retrieved from the Access Token issuer
                        this.userManager.CreateUser(userInfo);

                        // Set the properties that indicate that the user is authenticated and authorized to execute the method
                        this.IsAuthenticated = true;
                        this.IsAuthorized = true;
                    }
                }
            }
        }
开发者ID:Teunozz,项目名称:nl.fhict.intellicloud.backend,代码行数:40,代码来源:AuthorizationHandler.cs

示例8: User

 public User( string username, string password, UserType accesstype)
 {
     //no id, for insertion of new users
     this.UserName = username;
     this.UserPassword = password;
     this.AccessType = accesstype;
 }
开发者ID:pistr119,项目名称:MSSE682,代码行数:7,代码来源:User.cs

示例9: UserToken

 public UserToken(string guid, DateTime lastAccessed, UserType userType, int? id)
 {
     GUID = guid;
     LastAccessed = lastAccessed;
     Type = userType;
     ID = id;
 }
开发者ID:DavidA94,项目名称:omicron,代码行数:7,代码来源:UserToken.cs

示例10: SelectOption

	public void SelectOption (int option)
	{
		label.text = labels[option];
		ToggleOptions ();
		CurrentType = (UserType) option;
		ToogleOption ();
	}
开发者ID:juliancruz87,项目名称:transpp,代码行数:7,代码来源:ComboBoxType.cs

示例11: CreateNewUserDashboard

        public static void CreateNewUserDashboard(int uid, UserType utype)
        {
            //Adds 4 entries to dashboardsettings table to give user default dash items 1 item for customers
            LINQ_UsersDataContext dc = new LINQ_UsersDataContext();
            List<string> DefaultDashItems = ListDashboardItems(utype);
            if (utype == UserType.AccountCustomer)
            {
                DashBoardSetting ds = new DashBoardSetting();
                ds.DashBoardNumber = 1;
                ds.DashBoardItem = DefaultDashItems[2];
                ds.UserId = uid;

                dc.DashBoardSettings.InsertOnSubmit(ds);
            }
            else
            {
                for (int i = 1; i <= 4; i++)
                {
                    DashBoardSetting ds = new DashBoardSetting();
                    ds.DashBoardNumber = i;
                    ds.DashBoardItem = DefaultDashItems[i];
                    ds.UserId = uid;

                    dc.DashBoardSettings.InsertOnSubmit(ds);
                }
            }
            try
            {
                dc.SubmitChanges();
            }
            catch (Exception ex)
            {
                Database.WriteException("Error inserting new DashBoardSettings items", uid, "Users.CreateNewUserDashboard", ex);
            }
        }
开发者ID:dhuyvaert,项目名称:Sam_Solution,代码行数:35,代码来源:Users.cs

示例12: ValidateDealer

 public static void ValidateDealer(UserType userType)
 {
     if (userType != UserType.Dealer)
     {
         throw new ServerErrorException("User is not a dealer!");
     }
 }
开发者ID:vaskosound,项目名称:CarsStore,代码行数:7,代码来源:UserValidator.cs

示例13: ValidateAdmin

 public static void ValidateAdmin(UserType userType)
 {
     if (userType != UserType.Administrator)
     {
         throw new ServerErrorException("User is not an administrator!");
     }
 }
开发者ID:vaskosound,项目名称:CarsStore,代码行数:7,代码来源:UserValidator.cs

示例14: User

 public User(string username, string password, string email, UserType type)
 {
     Username = username;
     Password = password;
     Email = email;
     Type = type;
 }
开发者ID:dmab0914-Gruppe-2,项目名称:3-Semester-Project-Share,代码行数:7,代码来源:User.cs

示例15: RegisterUser

        public RollingRides.WebApp.Components.Datalayer.Models.User RegisterUser(string username, string password, string email, string phoneNumber,
		                  string firstName, string lastName,
		                  string street1, string street2,
		                  string city, string state, string zipcode, 
		                  UserType type, string companyName)
        {
            var user = new Components.Datalayer.Models.User();
            user.AccountType =(int) type;
            user.Username = username;
            user.City = city;
            user.DateJoined = DateTime.Now;
            user.Email = email;
            user.CompanyName = companyName;
            user.Expires = null;
            user.FirstName = firstName;
            user.LastName = lastName;
            //user.Id = -1;
            user.State = state;
            user.Street1 = street1;
            user.Street2 = street2;
            user.ZipCode = zipcode;
            user.PhoneNumber = phoneNumber;
            user.Password = password;
            return _userRepository.AddUpdate (user);
        }
开发者ID:alexwoodvisionps,项目名称:RollinRidesSite,代码行数:25,代码来源:UserManager.cs


注:本文中的UserType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。