• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UserType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: User

 public User(string name, UserType type)
 {
     ID = Guid.NewGuid();
     UserName = name;
     Type = type;
     userStatus = UserStatus.Active;
 }
开发者ID:cnorin,项目名称:Lab2,代码行数:7,代码来源:User.cs


示例17: OptionOfBroadcast

        public OptionOfBroadcast(UserType typeOfUser, TextBox textBox_Status)
        {

            //определяем соотношение сторон
            //if (pictureBoxTool.ratio == 1.33)
            //{
            //    showWidthRectangleCell = 4;
            //    showHeightRectangleCell = 3;
            //}
            //else if (pictureBoxTool.ratio == 1.78)
            //{
            //    showWidthRectangleCell = 16;
            //    showHeightRectangleCell = 9;
            //}
            //else //1.6
            //{
            //    showWidthRectangleCell = 16;
            //    showHeightRectangleCell = 10;
            //}
            //this.pictureBoxTool = pictureBoxTool;


            partnerIp = IPAddress.Parse(ReadWriteTextFile.GetIpSetting());
            int.TryParse(ReadWriteTextFile.GetPortSetting(), out port);

            textBox = new FormTextBox_Status(textBox_Status);
            this.typeOfUser = typeOfUser;
        }
开发者ID:BroZZZ,项目名称:DesktopViewerBeta,代码行数:28,代码来源:Helper.cs


示例18: SendInvitation

        //Add an entry in the ACL, and send an invitation email
        public void SendInvitation(string email, Guid ProjectID, UserType userType, IEmailSender emailSender)
        {
            //Database access
            var db = new ApplicationDBContext();

            //make sure this isnt a duplicate
            if (db.UsersAccessProjects.Where(acl => acl.Email == email && acl.ProjectID == ProjectID).Count() == 0)
            {
                //Working with ACL
                var acl = new UsersAccessProjects();
                acl.Email = email;
                acl.invitationAccepted = false;
                acl.ProjectID = ProjectID;
                acl.UserID = null;

                //Save the ACL entry
                db.UsersAccessProjects.Add(acl);
                db.SaveChanges();

                //build an invitaion email
                string body;
                body = "You have been invited to a new project.\n";
                body += "Click the link to accept the invitation.\n";
                body += "http://northcarolinataxrecoverycalculator.apphb.com/Project/AcceptInvite/" + acl.ID;

                //send an invitaion email
                emailSender.SendMail(email, "You have been invited to a project", body);
            }
        }
开发者ID:kevinhicks,项目名称:NorthCarolinaTaxRecoveryCalculator,代码行数:30,代码来源:AccountServices.cs


示例19: User

 public User(string n, string e, string p, UserType ut)
 {
     _name = n;
     _email = e;
     _password = p;
     _permissions = ut;
 }
开发者ID:TruYuri,项目名称:SAPS,代码行数:7,代码来源:User.cs


示例20: CommandHandler

 private CommandHandler(string name, UserType access, DelayType delayType, Func<MessageEventArgs, ChatMemberViewModel, SendMessage> handler)
 {
     Name = name.ToLower();
     Access = access;
     DelayType = delayType;
     Handler = handler;
 }
开发者ID:Zaharkov,项目名称:TwitchChat,代码行数:7,代码来源:CommandHandler.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UserViewModel类代码示例发布时间:2022-05-24
下一篇:
C# UserStore类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap