Exemple #1
0
        public void SetFromName(string name)
        {
            Name = name;
            switch (ItemDictionary.FirstOrDefault(p => p.Value == Name).Key)
            {
            case -1:
                Id = 1;
                break;

            case -2:
                Id = 4;
                break;

            case -3:
                Id = 6;
                break;

            case -4:
                Id = 10;
                break;

            case -5:
                Id = 7;
                break;

            case -6:
                Id = 99;
                break;

            case -7:
                Id = 1;
                break;

            case -8:
                Id = 4;
                break;

            case -9:
                Id = 6;
                break;

            case -10:
                Id = 10;
                break;

            case -11:
                Id = 7;
                break;

            case -12:
                Id = 99;
                break;

            case -13:
                Id = 1;
                break;

            case -14:
                Id = 4;
                break;

            case -15:
                Id = 6;
                break;

            case -16:
                Id = 10;
                break;

            case -17:
                Id = 7;
                break;

            case -18:
                Id = 99;
                break;

            case -19:
                Id = 198;
                break;

            case -20:
                Id = 199;
                break;

            case -21:
                Id = 200;
                break;

            case -22:
                Id = 201;
                break;

            case -23:
                Id = 202;
                break;

            case -24:
                Id = 203;
                break;

            default:
                Id = ItemDictionary.FirstOrDefault(p => p.Value == Name).Key;
                break;
            }

            OnPropertyChanged("Name");
        }