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

C# Gender类代码示例

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

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



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

示例1: Customer

        readonly int intCustomerID; //Note that this is a read only Field!

        #endregion Fields

        #region Constructors

        public Customer(int CustomerID, string Name, DateTime DOB, Gender Gender)
        {
            this.intCustomerID = CustomerID; //Read Only fields must be set by the constructor.
            this.Name = Name;
            this.DOB = DOB;
            this.Gender = Gender;
        }
开发者ID:jcolas,项目名称:CodeProjects,代码行数:13,代码来源:Customer.cs


示例2: Person

 public Person(string firstName, string lastName,int age, Gender sex = Gender.NotSpecified)
 {
     this.FirstName = firstName;
     this.LastName = lastName;
     this.Gender = sex;
     this.Age = age;
 }
开发者ID:Vyara,项目名称:Telerik-Academy,代码行数:7,代码来源:Person.cs


示例3: Person

 public Person(string Name, DateTime DOB, Gender Gender)
 {
     //NewMethod( Name,  DOB,  Gender); 
     this.Name = Name;
     this.dtDOB = DOB;
     this.Gender = Gender;
 }
开发者ID:lorneroy,项目名称:CSharpClass,代码行数:7,代码来源:Person.cs


示例4: Person

 public Person(string _firstName, string _lastName, int _age, Gender _gender)
 {
     firstName = _firstName;
     lastName = _lastName;
     age = _age;
     gender = _gender;
 }
开发者ID:oblivious,项目名称:Oblivious,代码行数:7,代码来源:Program.cs


示例5: Person

 public Person(DateTime Birthdate, string Firstname, string Name, Gender Gender)
 {
     this.Birthdate = Birthdate;
     this.Firstname = Firstname;
     this.Name = Name;
     this.Gender = Gender;
 }
开发者ID:Mortion,项目名称:Uses,代码行数:7,代码来源:Person.cs


示例6: Adult

 public Adult ( string name , Gender g, bool b )
 {
     sex = g;
     this.name = name;
     children = new List<Child>();
     IsBoring = b;
 }
开发者ID:Metatagross,项目名称:HackBulgaria-CSharp,代码行数:7,代码来源:Adult.cs


示例7: GetNextName

		public string GetNextName(int? count, Gender gender, bool animal, System.Random randomNumber)
		{
			//sets an internal counter and escape
			count = (count ?? 0);
			if (count == 50)
			{
				return "";
			}

			string freshName = "";

			if (animal)
			{
				return animalNames[randomNumber.Next(0, animalNames.Count)];
			}
			else
			{
				freshName = gender == Gender.Female ? femaleNames[randomNumber.Next(0, femaleNames.Count)] : maleNames[randomNumber.Next(0, maleNames.Count)];
				freshName += " " + lastNames[randomNumber.Next(0, lastNames.Count)];
			}

			if (usedNames.Contains(freshName))
			{
				return GetNextName(count + 1, gender, animal, randomNumber);
			}
			else
			{
				usedNames.Add(freshName);
				return freshName;
			}
		}
开发者ID:aflegel,项目名称:GameJamRegina2016,代码行数:31,代码来源:NamePool.cs


示例8: Animal

 public Animal(string name, int age, Gender sex)
 {
     this.Name = name;
     this.Age = age;
     this.Sex = sex;
     this.Type = AnimalType.Unknown;
 }
开发者ID:RuzmanovDev,项目名称:TelerikAcademy,代码行数:7,代码来源:Animal.cs


示例9: addPatientYear

        public void addPatientYear(Gender gender, double startAge, double endAge)
        {
            int genderInt = gender == Gender.Male ? 1 : 0;
            int startAgeInt = Convert.ToInt32(Math.Truncate(startAge));
            int endAgeInt = Convert.ToInt32(Math.Truncate(endAge));
            if (startAge > startAgeInt)
            {
                double startResidual = (startAgeInt + 1) - startAge;
                table[startAgeInt, genderInt].patientYear += startResidual;
                startAgeInt++;
            }
            if (endAgeInt < 100)
            {
                if (endAge > endAgeInt)
                {
                    double endResidual = endAge - endAgeInt;
                    table[endAgeInt, genderInt].patientYear += endResidual;
                }
            }
            else
            {
                endAgeInt = 100;
            }

            for (int i = startAgeInt; i < endAgeInt; i++)
            {
                table[i, genderInt].patientYear++;
            }
        }
开发者ID:david855033,项目名称:NHIRD,代码行数:29,代码来源:AgeSpecificIncidenceTable.cs


示例10: MoreDetailsCommand

 public MoreDetailsCommand(
     Guid userId,
     string firstName,
     string lastName,
     string address,
     string suburb,
     string city,
     string country,
     string postcode,
     Gender gender,
     Orientation orientation,
     bool romance,
     bool friendship)
 {
     UserId = userId;
     FirstName = firstName;
     LastName = lastName;
     Address = address;
     Suburb = suburb;
     City = city;
     Country = country;
     Postcode = postcode;
     Gender = gender;
     Orientation = orientation;
     Romance = romance;
     Friendship = friendship;
 }
开发者ID:jladuval,项目名称:MyPlace,代码行数:27,代码来源:MoreDetailsCommand.cs


示例11: Employee

 public Employee(int EmployeeId, string Name, DateTime DOB, Gender Gender)
 :base(Name, DOB, Gender) 
 {
    this.EmployeeId = EmployeeId;
    // this.Name = Name; This is not needed since the base constructor will be 
     // passed the data in with  :base(Name, DOB, Gender) 
 }
开发者ID:lorneroy,项目名称:CSharpClass,代码行数:7,代码来源:Employee.cs


示例12: PlayerCharacter

 public PlayerCharacter(MainWindow main, string name, int birthdate, Dynasty dynasty, int money, Game game, Gender gender)
     : base(name, birthdate, dynasty, money, game, gender)
 {
     this.main = main;
     notificator = new Notificator();
     notificator.Show();
 }
开发者ID:jenn0108,项目名称:CourtIntrigue,代码行数:7,代码来源:PlayerCharacter.cs


示例13: AddNewContact

 /// <summary>
 /// Adds new contact to MagtiFun contacts list
 /// </summary>
 /// <param name="firstName">Person's first name</param>
 /// <param name="lastName">Person's last name</param>
 /// <param name="mobileNumber">Person's phone number</param>
 /// <param name="nickName">Person's nickname</param>
 /// <param name="dateOfBirth">Person's date of birth</param>
 /// <param name="birthDayRemind">Notify or not about new contact's birthday</param>
 /// <param name="gender">Person's gender</param>
 /// <returns>
 /// Response code
 /// </returns>        
 public string AddNewContact(string firstName, string mobileNumber, string nickName="", string lastName="",  DateTime? dateOfBirth=null, bool birthDayRemind=false, Gender gender=Gender.Male)
 {
     using (var handler = new HttpClientHandler { UseCookies = false })
     using (var client = new HttpClient(handler))
     {
         var message = new HttpRequestMessage(HttpMethod.Post, ADD_CONTACT_URL)
         {
             Content = new FormUrlEncodedContent(new[]
             {
                 new KeyValuePair<string, string>("f_name", firstName),
                 new KeyValuePair<string, string>("m_name", nickName),
                 new KeyValuePair<string, string>("l_name", lastName),
                 new KeyValuePair<string, string>("day", dateOfBirth?.Day.ToString()),
                 new KeyValuePair<string, string>("month", dateOfBirth?.Month.ToString()),
                 new KeyValuePair<string, string>("year", dateOfBirth?.Year.ToString()),
                 new KeyValuePair<string, string>("bday_remind", (birthDayRemind ? 1 : 0).ToString()),
                 new KeyValuePair<string, string>("gender", ((int)gender).ToString()),
                 new KeyValuePair<string, string>("mobile_number", mobileNumber)
             })
         };
         message.Headers.Add("Cookie", cookie);
         var result = client.SendAsync(message).Result;
         var responseCode = result.Content.ReadAsStringAsync().Result;
         return responseCode;
     }
 }
开发者ID:Duke-fleed,项目名称:Magtifun-API,代码行数:39,代码来源:MagtifunHelper.cs


示例14: Person

 public Person(String pName, Gender pGender, MaritalStatus pMaritalStatus, int pEdad)
 {
     this.Name = pName;
     this.Gender = pGender;
     this.MaritalStatus = pMaritalStatus;
     this.Age = pEdad;
 }
开发者ID:ramarivera,项目名称:StartingCity,代码行数:7,代码来源:Person.cs


示例15: CreateNewUser

    /// <summary>
    /// Adds information about the user/player
    /// </summary>
    /// <param name="gender">
    /// The gender of the user. If the gender is unknown information will not be submitted.
    /// </param>
    /// <param name="birth_year">
    /// The year the user was born. Set to "null" if unknown.
    /// </param>
    /// <param name="country">
    /// The ISO2 country code the user is playing from. See: http://en.wikipedia.org/wiki/ISO_3166-2. Set to "null" if unknown.
    /// </param>
    /// <param name="state">
    /// The code of the country state the user is playing from. Set to "null" if unknown.
    /// </param>
    /// /// <param name="friend_count">
    /// The number of friends in the user's network. Set to "null" if unknown.
    /// </param>
    private void CreateNewUser(Gender gender, int? birth_year, int? friend_count)
    {
        Hashtable parameters = new Hashtable();

        if (gender == Gender.Male)
        {
            parameters.Add(GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Gender], 'M');
        }
        else if (gender == Gender.Female)
        {
            parameters.Add(GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Gender], 'F');
        }

        if (birth_year.HasValue && birth_year.Value != 0)
        {
            parameters.Add(GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Birth_year], birth_year.ToString());
        }

        if (friend_count.HasValue)
        {
            parameters.Add(GA_ServerFieldTypes.Fields[GA_ServerFieldTypes.FieldType.Friend_Count], friend_count.ToString());
        }

        if (parameters.Count == 0)
        {
            GA.LogWarning("GA: No data to send with NewUser event; event will not be added to queue");
            return;
        }

        GA_Queue.AddItem(parameters, GA_Submit.CategoryType.GA_User, false);
    }
开发者ID:robert-wallis,项目名称:LD26-minimalism,代码行数:49,代码来源:GA_User.cs


示例16: Shoud_detect_gender_if_auto_detection_is_set

        public void Shoud_detect_gender_if_auto_detection_is_set(string middleName, Gender expected)
        {
            var petrovich = new Petrovich {AutoDetectGender = true, MiddleName = middleName};
            petrovich.InflectMiddleNameTo(Case.Accusative);

            Assert.AreEqual(expected, petrovich.Gender);
        }
开发者ID:hVostt,项目名称:petrovich-net,代码行数:7,代码来源:PetrovichFixture.cs


示例17: PersonBase

 //constructor
 public PersonBase(string firstName, string lastName, Gender gender, int age=18)
 {
     this.FirstName = firstName;
     this.LastName = lastName;
     this.Gender = gender;
     this.Age = age;
 }
开发者ID:Cecosam,项目名称:Csharp-Projects,代码行数:8,代码来源:PersonBase.cs


示例18: Person

 public Person(string firstName, string lastName, int age, Gender gender)
 {
     _firstName = firstName;
     _lastName = lastName;
     _age = age;
     _gender = gender;
 }
开发者ID:simghost,项目名称:MyCert,代码行数:7,代码来源:Program.cs


示例19: Dog

 public Dog(string name, byte age, Gender gender)
     : base(name, age, gender)
 {
     this.Name = name;
     this.Age = age;
     this.Gender = gender;
 }
开发者ID:unbelt,项目名称:SoftUni,代码行数:7,代码来源:Dog.cs


示例20: AddContact

        public void AddContact(string name, string streetAndNumber, short zipCode, string city, Gender gender, DateTime birthDay,
            string phone, string mobile)
        {
            Contact newContact = new Contact()
            {
                Name = name,
                Address = new Address()
                {
                    StreetNumber = streetAndNumber,
                    AddressId = 1,
                    ZipCode = zipCode
                },
                Birthday = birthDay,
                Blocked = false,
                Categories = new List<Category>(),
                Gender = gender,
                Mobile = mobile,
                Phone = phone
            };

            newContact.Address.Contact = newContact;
            ValidateContact(newContact);

            contactRepository.CreateContact(newContact);
        }
开发者ID:Lievelingsduif,项目名称:Prak_Contacten,代码行数:25,代码来源:ContactManager.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# GenderType类代码示例发布时间:2022-05-24
下一篇:
C# GemType类代码示例发布时间: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