Example #1
0
        public async Task Setup(IDictionary <string, object> variables)
        {
            var disk = await Detection.GetDisk(fileSystem);

            if (disk != null)
            {
                variables[Requirement.Disk] = disk.Number;
            }
        }
Example #2
0
        public async Task Setup(IDictionary <string, object> variables)
        {
            var disk = await Detection.GetDisk(fileSystem);

            if (disk == null)
            {
                throw new InvalidOperationException("Cannot detect the phone disk. Is the phone connected in Mass Storage Mode?");
            }

            variables[Requirement.Disk] = disk.Number;
        }
Example #3
0
        public async Task <Device> Detect()
        {
            var disk = await Detection.GetDisk(fileSystem);

            if (disk != null)
            {
                var model = reader.GetPhoneModel(disk.Number);

                switch (model.Model)
                {
                case PhoneModel.Cityman:
                    switch (model.Variant)
                    {
                    case Variant.SingleSim:
                        return(Device.CitymanSs);

                    case Variant.DualSim:
                        return(Device.CitymanDs);

                    default:
                        throw new ArgumentOutOfRangeException();
                    }

                case PhoneModel.Talkman:
                    switch (model.Variant)
                    {
                    case Variant.SingleSim:
                        return(Device.TalkmanSs);

                    case Variant.DualSim:
                        return(Device.TalkmanDs);

                    default:
                        throw new ArgumentOutOfRangeException();
                    }

                case PhoneModel.Hapanero:
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }
            }

            return(null);
        }