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


C# Gender类代码示例

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


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


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