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

C# Sex类代码示例

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

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



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

示例1: SavePerson

        public void SavePerson(string name, Sex sex, DateTime birthDateUtc, string biography)
        {
            // Let's also practice exception handling.
            if (String.IsNullOrEmpty(name)) throw new ArgumentNullException("name");

            var person = _personRepository.Fetch(record => record.Name == name).FirstOrDefault();

            if (person == null)
            {
                person = new PersonRecord();
                _personRepository.Create(person);
            }

            person.Name = name;
            person.Sex = sex;
            person.BirthDateUtc = birthDateUtc;
            person.Biography = biography;

            // Running filters
            // Normally we don't persist the result of filters though.
            foreach (var filter in _filters)
            {
                person.Biography = filter.FilterBiography(person.Biography);
            }
        }
开发者ID:hyrmedia,项目名称:Orchard-Training-Demo-Module,代码行数:25,代码来源:PersonManager.cs


示例2: Person

 public Person(string name, DateTime birthday, Sex gender)
 {
     this.Name = name;
     this.Birthday = birthday;
     this.Gender = gender;
     this.Id = NEXT_ID++;
 }
开发者ID:JPGoldenPheasant,项目名称:MyRepository,代码行数:7,代码来源:Person.cs


示例3: Result

        public Result(Age a, Sex s, Profession p, Education e, YesNo cit, 
		               List<Technology> tech, Frequency pub, Frequency home,
		               NumPass single, List<PassType> passType, Frequency pChange,
		               YesNo sharePass,YesNo pSecure, YesNo passHome,YesNo pMobile, 
		               YesNo hWifiPass, YesNo hWifiFire, YesNo hVirusSoftware, YesNo softUpdate, 
		               SecureLevel sLevel, SharePersonalInfo postPersonal, Frequency pWifi)
        {
            m_age = a;
            m_sex = s;
            m_profession = p;
            m_education = e;
            m_usCitizen = cit;
            m_technologyList = tech;
            m_publicComputer = pub;
            m_homeComputer = home;
            m_singlePass = single;
            m_passType = passType;
            m_passChangeFreq = pChange;
            m_sharePassword = sharePass;
            m_passSecure = pSecure;
            m_passHomePC = passHome;
            m_passForMobile = pMobile;
            m_homeWifiPass = hWifiPass;
            m_homeWifiFirewall = hWifiFire;
            m_homeVirusSoftware = hVirusSoftware;
            m_softwareUpdates = softUpdate;
            m_securityLevel = sLevel;
            m_postPersonalInfo = postPersonal;
            m_publicWifi = pWifi;
        }
开发者ID:pdg6868,项目名称:SecurityTool,代码行数:30,代码来源:Result.cs


示例4: Person

 /// <summary>
 /// 
 /// </summary>
 /// <param name="info"></param>
 /// <param name="ctxt"></param>
 public Person(SerializationInfo info, StreamingContext ctxt)
 {
     _full_name = info.GetString("full_name");
     _sex = (Sex)info.GetValue("sex", typeof(Sex));
     _birth_date = info.GetDateTime("birth_date");
     _photo_path = info.GetString("photo_path");
 }
开发者ID:peeboo,项目名称:open-media-library,代码行数:12,代码来源:Person.cs


示例5: Dog

 //constructor
 public Dog(string name, int age, Sex sex, FurColour furColour)
 {
     this.Name = name;
     this.Age = age;
     this.Sex = sex;
     this.FurColour = furColour;
 }
开发者ID:Varbanov,项目名称:TelerikAcademy,代码行数:8,代码来源:Dog.cs


示例6: Entity

 Entity(long date, Sex sex, int motherId, int fatherId)
 {
     _birthday = date;
     _sex = sex;
     _motherId = motherId;
     _fatherId = fatherId;
 }
开发者ID:thebuchanan3,项目名称:ContinentsCs,代码行数:7,代码来源:Entity.cs


示例7: CreatePlayer

 private static Player CreatePlayer(string name, PlayerColor color, Sex sex, int n)
 {
     var player = new Player(name, color, sex);
       int i = 0;
       StuffManager stuffManager = StuffManager.Instance;
       foreach (IDxMCard dxMCard in stuffManager.DxMCards)
       {
     if (dxMCard is ICheatCard) continue;
     if (dxMCard is IRaceCard && player.RaceCards.Count < 2)
       player.RaceCards.Add((IRaceCard)dxMCard);
     else if (dxMCard is IClassCard && player.ClassCards.Count < 2)
       player.ClassCards.Add((IClassCard)dxMCard);
     else if (dxMCard is IHalfBreededCard)
       player.HalfBreededCard = (IHalfBreededCard)dxMCard;
     else if (dxMCard is ISuperManchkinCard)
       player.SuperManchkinCard = (ISuperManchkinCard)dxMCard;
     else
       player.HandCards.Add(dxMCard);
       }
       foreach (ITreasureCard treasureCard in stuffManager.TreasureCards)
       {
     ICheatCard cheatCard = i++ == 4 ? stuffManager.DxMCards.OfType<ICheatCard>().Single() : null;
     player.WornItems.Add(Tuple.Create(treasureCard, cheatCard));
       }
       /*
     for (int j = 0; j < n * 2; j++)
       player.HandCards.Add(cardManager.TreasureCards.First());
       */
       return player;
 }
开发者ID:valentinkip,项目名称:Test,代码行数:30,代码来源:App.xaml.cs


示例8: OnCreatePlayer

        /// <summary>
        /// 创建玩家
        /// </summary>
        /// <param name="netstate"></param>
        /// <param name="playerName"></param>
        /// <param name="sex"></param>
        public void OnCreatePlayer(NetState netstate, string playerName, Sex sex)
        {
            //  如果已经创建过(例如玩家连续点了两次创建角色)
            var player = WorldEntityManager.PlayerCache.GetEntity(netstate.BizId);
            if (player != null)
            {
                ClientProxy.Login.CreatePlayerResult(netstate, CraetePlayerResult.Fail);
                return;
            }

            player = new Player
            {
                Id = netstate.BizId,
                AccountId = netstate.BizId,
                Name = playerName,
                Sex = sex,
                NetState = netstate
            };

            DB.GameDB.InsertEntity(player);

            WorldEntityManager.PlayerCache.AddOrReplace(player);

            Logs.Info("角色 {0}({1}) 创建成功", playerName, player.Id);

            netstate.Player = player;
            PlayerEnterGame(player);

            ClientProxy.Login.CreatePlayerResult(netstate, CraetePlayerResult.Success);
        }
开发者ID:xiaobodu,项目名称:DogSE,代码行数:36,代码来源:LoginModule.cs


示例9: GetPersons

 // We'll need this later for PersonListPart.
 public IEnumerable<PersonRecord> GetPersons(Sex sex, int maxCount)
 {
     // _personRepository.Fetch(record => record.Sex == sex).Take(maxCount) would produce the same result. However
     // since Fetch() returns an IEnumerable, not an IQueryable, Take() would run on objects, not translated to SQL.
     // Hence the below version can perform better.
     return _personRepository.Table.Where(record => record.Sex == sex).Take(maxCount);
 }
开发者ID:hyrmedia,项目名称:Orchard-Training-Demo-Module,代码行数:8,代码来源:PersonManager.cs


示例10: AnnualPolicy

 public AnnualPolicy(Age age, Sex gender, Destination destination, Tax tax)
 {
     this.age = age;
     this.gender = gender;
     this.destination = destination;
     this.tax = tax;
 }
开发者ID:mwinder,项目名称:kata-insurance-november2013,代码行数:7,代码来源:AnnualPolicy.cs


示例11: SetRecomendedCalories

    public static void SetRecomendedCalories(int age, Sex sex) {
        if (sex == Sex.Female) {
            if (age == 12) {
                DailyRecomendedCalories = 1800;
            }
            else if (age > 12 && age < 15) {
                DailyRecomendedCalories = 2000;
            }
            else if (age == 15) {
                DailyRecomendedCalories = 2200;
            }
            else if (age > 16 && age < 19) {
                DailyRecomendedCalories = 2400;
            }
            else if (age > 18 && age < 21) {
                DailyRecomendedCalories = 2600;
            }
            else {
                DailyRecomendedCalories = 2400;
            }
        }
        if (sex == Sex.Male) {
            if (age < 14) {
                DailyRecomendedCalories = 1600;
            }
            else if (age > 13 && age < 19) {
                DailyRecomendedCalories = 1800;
            }

            else {
                DailyRecomendedCalories = 2000;
            }

        }
    }
开发者ID:Evorlor,项目名称:Fitachi,代码行数:35,代码来源:AdventureStats.cs


示例12: CreatePair

        Human CreatePair(Human human, Sex gender)
        {
            if (human == null)
            {
                throw new ArgumentNullException();
            }

            Human newHuman;
            if (human is Botan)
            {
                newHuman = CreateCoolParentPair(human as Botan);
            }
            else if (human is CoolParent)
            {
                newHuman = CreateBotanPair(human as CoolParent, gender);
            }
            else if (human is Student)
            {
                newHuman = CreateParentPair(human as Student);
            }
            else if (human is Parent)
            {
                newHuman = CreateStudentPair(human as Parent, gender);
            }
            else
            {
                throw new ArgumentNullException();
            }
            Humans.Add(newHuman);
            return newHuman;
        }
开发者ID:resaglow,项目名称:study,代码行数:31,代码来源:God.cs


示例13: Animals

    public Animals(float age, string name, Sex sex)
    {
        this.Age = age;
        this.Name = name;
        this.Sex = sex;

        if (this.GetType().Name == "Tomcat")
        {
            this.Sex = Sex.male;
        }
        else if (this.GetType().Name == "Kitten")
        {
            this.Sex = Sex.female;
        }
        if (this.GetType().Name == "Dog")
        {
            this.Sound = "Woof-Woof";
        }
        else if (this.GetType().Name == "Kitten")
        {
            this.Sound = "Meooow";
        }
        else if (this.GetType().Name == "Tomcat")
        {
            this.Sound = "Meow";
        }
        else if (this.GetType().Name == "Frog")
        {
            this.Sound = "Ribbit-ribbit";
        }
    }
开发者ID:unbelt,项目名称:Telerik,代码行数:31,代码来源:Animals.cs


示例14: Build

            public IEntity Build()
            {
                if (_sex == Sex.UNDEFINED)
                    _sex = GetRandomSex();

                return new Entity(_birthday, _sex, _motherId, _fatherId);
            }
开发者ID:thebuchanan3,项目名称:ContinentsCs,代码行数:7,代码来源:Entity.control.cs


示例15: Animals

 public Animals(string name, byte age, Sex sex)
 {
     this.Name = name;
     this.Age = age;
     Sex gender = sex;
     this.Sound = "";
 }
开发者ID:Kaloyan-kasskata-Anastasov,项目名称:All-HomeWorks-SoftwareUniversity-TelerikAcademy,代码行数:7,代码来源:Animals.cs


示例16: Animal

 public Animal(string name, Sex sex, byte age, string type)
 {
     this.Name = name;
     this.Sex = sex;
     this.Age = age;
     this.Type = type;
 }
开发者ID:NikolaiMishev,项目名称:Telerik-Academy,代码行数:7,代码来源:Animal.cs


示例17: GetSearchableCountries

        public IList<string> GetSearchableCountries(Sex gender)
        {
            using (var session = _documentStore.OpenSession()) {
                try {
                    var query = (from item in session.Query<CountryCityCountResult, CountryCityCountIndex>().Where(p => p.Gender == (byte) gender).ToList()
                                 group item by new {item.CountryName}
                                 into g
                                 let o = new {g.Key.CountryName}
                                 orderby o.CountryName
                                 select g.Key.CountryName);
                    return  query.ToList();

                        //(from item in session.Query<CountryCityCountResult, CountryCityCountIndex>().Where(p => p.Gender == (byte)gender).ToList()
                        //         group item by new {item.CountryCode, item.CountryName}
                        //             into g
                        //             let o = new {Sum = g.Sum(x => x.Count), g.Key.CountryCode, g.Key.CountryName}
                        //             orderby o.Sum descending
                        //             select new {g.Key.CountryCode, g.Key.CountryName});
                    //var dictionary = new Dictionary<string, string>();
                    //foreach (var item in query)
                    //    if(item != null && !String.IsNullOrWhiteSpace(item.CountryCode) && !dictionary.ContainsKey(item.CountryCode))
                    //        dictionary.Add(item.CountryCode, item.CountryName);
                    //return dictionary;
                } catch(InvalidOperationException) {
                    return new List<string>();
                }
            }


            
        }
开发者ID:ramazanaktolu,项目名称:MS.Katusha,代码行数:31,代码来源:CountryCityCountRepositoryRavenDB.cs


示例18: Frog

 //constructor
 public Frog(string name, int age, Sex sex, int greenSpots)
 {
     this.Name = name;
     this.Age = age;
     this.Sex = sex;
     this.greenSpots = greenSpots;
 }
开发者ID:Varbanov,项目名称:TelerikAcademy,代码行数:8,代码来源:Frog.cs


示例19: CorporateCustomer

 //Constructor
 public CorporateCustomer(string customerID, string companyName, Address companyAddress, string regNumber,
                          string firstName, string middleName, string lastName, Sex sex, decimal pin)
     : base(customerID, firstName, middleName, lastName, sex, companyAddress, pin)
 {
     this.CompanyName = companyName;
     this.RegNumber = regNumber;
 }
开发者ID:vstaykov,项目名称:Personal-Projects,代码行数:8,代码来源:CorporateCustomer.cs


示例20: Person

 public Person(string name,int age, Sex sex, Race race, String favoriteCar )
 {
     Name = name;
     Age = age;
     Sex = sex;
     Race = race;
     FavoriteCar = favoriteCar;
 }
开发者ID:Warox23,项目名称:chmo,代码行数:8,代码来源:Person.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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