コード例 #1
0
 public static string SplitName(this string name, char splitter, NameEnum nameSplit)
 {
     if (nameSplit == NameEnum.FirstName)
     {
         return(name.Split(splitter)[1]);
     }
     return(name.Split(splitter)[0]);
 }
コード例 #2
0
 public Session(int benChang, int qianBang, SessionEnum session, NameEnum oyaNameEnum, int flag)
 {
     BenChang   = benChang;
     QianBang   = qianBang;
     NowSession = session;
     OyaName    = oyaNameEnum;
     Flag       = flag;
 }
コード例 #3
0
 public bool Equals(NameEnum obj)
 {
     if ((object)obj == null)
     {
         return(false);
     }
     return(StringComparer.OrdinalIgnoreCase.Equals(this.Value, obj.Value));
 }
コード例 #4
0
 public Player(int btn, int ckb, int point, NameEnum name, WindEnum wind, bool isreach)
 {
     Btn     = btn;
     Ckb     = ckb;
     Point   = point;
     Name    = name;
     Wind    = wind;
     IsReach = isreach;
 }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TelegrafPluginInputCpu" /> class.
 /// </summary>
 /// <param name="name">name (required) (default to NameEnum.Cpu).</param>
 /// <param name="comment">comment.</param>
 public TelegrafPluginInputCpu(NameEnum name = NameEnum.Cpu, TypeEnum type = TypeEnum.Input, string comment = default(string)) : base(type)
 {
     // to ensure "name" is required (not null)
     if (name == null)
     {
         throw new InvalidDataException("name is a required property for TelegrafPluginInputCpu and cannot be null");
     }
     else
     {
         this.Name = name;
     }
     this.Comment = comment;
 }
コード例 #6
0
ファイル: Card.cs プロジェクト: rxleska/BlackJack
 public Card(int numericValue, SuitEnum suit, NameEnum cardName)
 {
     if (numericValue == 1)
     {
         NumericValue = 11;
     }
     else
     {
         NumericValue = numericValue;
     }
     SuitNumeric    = suit;
     NameAlphabetic = cardName;
 }
コード例 #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TelegrafPluginInputRedis" /> class.
 /// </summary>
 /// <param name="name">name (required) (default to NameEnum.Redis).</param>
 /// <param name="comment">comment.</param>
 /// <param name="config">config (required).</param>
 public TelegrafPluginInputRedis(NameEnum name = NameEnum.Redis, TypeEnum type = TypeEnum.Input, string comment = default(string), TelegrafPluginInputRedisConfig config = default(TelegrafPluginInputRedisConfig)) : base(type)
 {
     // to ensure "name" is required (not null)
     if (name == null)
     {
         throw new InvalidDataException("name is a required property for TelegrafPluginInputRedis and cannot be null");
     }
     else
     {
         this.Name = name;
     }
     // to ensure "config" is required (not null)
     if (config == null)
     {
         throw new InvalidDataException("config is a required property for TelegrafPluginInputRedis and cannot be null");
     }
     else
     {
         this.Config = config;
     }
     this.Comment = comment;
 }
コード例 #8
0
 static NameEnum()
 {
     FirstName = new NameEnum("FirstName");
     LastName  = new NameEnum("LastName");
 }
コード例 #9
0
        static void Main(string[] args)
        {
            Adapter.StudentInfoAdapter adapter = new Adapter.StudentInfoAdapter();
            adapter.subtractStudentInfoList();
            Input input = new Input();
            bool  flag  = false;

Label1:
            if (flag)
            {
                Console.WriteLine("If you wanna crear the console area print yes," +
                                  " otherwise -- another phrase:");
                if (Console.ReadLine().ToUpper().Equals("YES"))
                {
                    Console.Clear();
                }
                else
                {
                    Console.WriteLine("----------------------------------------");
                }
            }
            Console.WriteLine("Choose the task(1..2) or exit option('EXIT'):");
            TaskEnum    task    = input.setTask();
            TaskManager manager = new TaskManagerImpl();

            switch (task)
            {
            case TaskEnum.TASK_1:
                flag = true;
                Console.WriteLine("Choose the developer's name for TASK_1\n" +
                                  "VIKTOR\n" +
                                  "MYKYTA\n" +
                                  "MAKSYM\n" +
                                  " return option('RETURN')\n or exit option('EXIT'):");
                NameEnum name = input.setName();
                switch (name)
                {
                case NameEnum.VIKTOR:
                    manager.doTask1_1();
                    break;

                case NameEnum.MYKYTA:
                    manager.doTask2_1();
                    break;

                case NameEnum.MAKSYM:
                    manager.doTask3_1();
                    break;

                case NameEnum.EXIT:
                    goto Label2;

                default:
                    goto Label1;
                }
                goto Label1;

            case TaskEnum.TASK_2:
                flag = true;
                Console.WriteLine("Choose the developer's name for TASK_2\n" +
                                  "VIKTOR\n" +
                                  "MYKYTA\n" +
                                  "MAKSYM\n" +
                                  " return option('RETURN')\n or exit option('EXIT'):");
                name = input.setName();
                switch (name)
                {
                case NameEnum.VIKTOR:
                    manager.doTask1_2();
                    break;

                case NameEnum.MYKYTA:
                    manager.doTask2_2();
                    break;

                case NameEnum.MAKSYM:
                    manager.doTask3_2();
                    break;

                case NameEnum.EXIT:
                    goto Label2;

                default:
                    goto Label1;
                }
                goto Label1;

            default:
                goto Label2;
            }
Label2:
            MessageBox.Show("Process has finished!");
            Console.ReadKey();
        }
コード例 #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EmbedSettingsTitle" /> class.
 /// </summary>
 /// <param name="name">How the embeddable player handles the video title.  Option descriptions:  * &#x60;hide&#x60; - The title is hidden.  * &#x60;show&#x60; - The title is shown.  (required).</param>
 /// <param name="owner">How the embeddable player handles the video owner&#39;s information.  Option descriptions:  * &#x60;hide&#x60; - The owner&#39;s information is hidden.  * &#x60;show&#x60; - The owner&#39;s information is shown.  (required).</param>
 /// <param name="portrait">How the embeddable player handles the video owner&#39;s portrait.  Option descriptions:  * &#x60;hide&#x60; - The owner&#39;s portrait is hidden  * &#x60;show&#x60; - The owner&#39;s portrait is shown.  (required).</param>
 public EmbedSettingsTitle(NameEnum name = default(NameEnum), OwnerEnum owner = default(OwnerEnum), PortraitEnum portrait = default(PortraitEnum))
 {
     this.Name     = name;
     this.Owner    = owner;
     this.Portrait = portrait;
 }