internal void StartLoadDeviceInfo()
        {
            lock (LockDeviceInfo)
            {
                if (!DeviceInfoLoaded)
                {
                    try
                    {
                        PhoneInfo Info = CurrentModel.ReadPhoneInfo();

                        if (Info.FlashAppProtocolVersionMajor < 2)
                        {
                            UefiSecurityStatusResponse SecurityStatus = CurrentModel.ReadSecurityStatus();

                            if (SecurityStatus != null)
                            {
                                EffectiveBootloaderSecurityStatus = SecurityStatus.SecureFfuEfuseStatus && !SecurityStatus.AuthenticationStatus && !SecurityStatus.RdcStatus;
                            }
                        }
                        else
                        {
                            EffectiveBootloaderSecurityStatus = Info.UefiSecureBootEnabled;
                        }

                        LogFile.Log("Effective Bootloader Security Status: " + EffectiveBootloaderSecurityStatus.ToString());
                    }
                    catch
                    {
                        LogFile.Log("Reading status from Flash interface was aborted.");
                    }
                    DeviceInfoLoaded = true;
                }
            }
        }
Exemplo n.º 2
0
        public bool Equals(SaveFileGTA3 other)
        {
            if (other == null)
            {
                return(false);
            }

            return(SimpleVars.Equals(other.SimpleVars) &&
                   Scripts.Equals(other.Scripts) &&
                   PlayerPeds.Equals(other.PlayerPeds) &&
                   Garages.Equals(other.Garages) &&
                   Vehicles.Equals(other.Vehicles) &&
                   Objects.Equals(other.Objects) &&
                   Paths.Equals(other.Paths) &&
                   Cranes.Equals(other.Cranes) &&
                   Pickups.Equals(other.Pickups) &&
                   PhoneInfo.Equals(other.PhoneInfo) &&
                   RestartPoints.Equals(other.RestartPoints) &&
                   RadarBlips.Equals(other.RadarBlips) &&
                   Zones.Equals(other.Zones) &&
                   Gangs.Equals(other.Gangs) &&
                   CarGenerators.Equals(other.CarGenerators) &&
                   ParticleObjects.Equals(other.ParticleObjects) &&
                   AudioScriptObjects.Equals(other.AudioScriptObjects) &&
                   PlayerInfo.Equals(other.PlayerInfo) &&
                   Stats.Equals(other.Stats) &&
                   Streaming.Equals(other.Streaming) &&
                   PedTypeInfo.Equals(other.PedTypeInfo));
        }
Exemplo n.º 3
0
        private void AddNewPhone_Click(object sender, EventArgs e)
        {
            PhoneInfo phone = new PhoneInfo();

            GetPhoneFilds(phone);
            PhoneRepository.Store.AddPhone(phone);
        }
Exemplo n.º 4
0
        internal override void EvaluateViewState()
        {
            if (!IsActive)
            {
                return;
            }

            if ((Notifier.CurrentInterface == PhoneInterfaces.Lumia_Flash))
            {
                NokiaFlashModel LumiaFlashModel = (NokiaFlashModel)Notifier.CurrentModel;
                PhoneInfo       Info            = LumiaFlashModel.ReadPhoneInfo();
                ProductType  = Info.Type;
                OperatorCode = "";
                ProductCode  = Info.ProductCode;
            }
            else if (Notifier.CurrentInterface == PhoneInterfaces.Lumia_Normal)
            {
                NokiaPhoneModel LumiaNormalModel = (NokiaPhoneModel)Notifier.CurrentModel;
                OperatorCode = LumiaNormalModel.ExecuteJsonMethodAsString("ReadOperatorName", "OperatorName");                             // Example: 000-NL
                string TempProductType = LumiaNormalModel.ExecuteJsonMethodAsString("ReadManufacturerModelName", "ManufacturerModelName"); // RM-821_eu_denmark_251
                if (TempProductType.IndexOf('_') >= 0)
                {
                    TempProductType = TempProductType.Substring(0, TempProductType.IndexOf('_'));
                }
                ProductType = TempProductType;
                ProductCode = LumiaNormalModel.ExecuteJsonMethodAsString("ReadProductCode", "ProductCode"); // 059Q9D7
            }
        }
Exemplo n.º 5
0
        private void RefreshPhones()
        {
            MainWindow.phoneInfo.Clear(); // очищаем всё, если там что-то будет
            string connectionString = @"Data Source=.\SQLEXPRESS;Initial Catalog=phones;Integrated Security=True";

            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                connection.Open();
                SqlCommand command = new SqlCommand();
                command.CommandText = "SELECT * FROM phoneTable";
                command.Connection  = connection;
                SqlDataReader reader = command.ExecuteReader();

                if (reader.HasRows)       // если есть данные
                {
                    while (reader.Read()) // построчно считываем данные
                    {
                        PhoneInfo phonik = new PhoneInfo();
                        phonik.Id      = Convert.ToInt32(reader.GetValue(0));
                        phonik.Id_Stud = Convert.ToInt32(reader.GetValue(0));
                        phonik.Id_Type = Convert.ToInt32(reader.GetValue(0));
                        phonik.Phone   = Convert.ToInt64(reader.GetValue(0));

                        phoneInfo.Add(phonik);
                    }
                }

                reader.Close();
            }
        }
Exemplo n.º 6
0
    public static bool CheckCanCacheResource()
    {
#if UNITY_EDITOR
        return(true);
#elif UNITY_IPHONE
        iPhoneGeneration iosGen = iPhone.generation;
        if (iosGen == iPhoneGeneration.iPhone4S ||
            iosGen == iPhoneGeneration.iPhone4)
        {
            return(true);
        }
        else
        {
            return(false);
        }
#elif UNITY_ANDROID
        long ram = long.Parse(PhoneInfo.getTotalMemory()) / 1024 / 1024;
        if (ram >= 1024)
        {
            return(false);
        }
        else
        {
            return(true);
        }
#else
        return(true);
#endif
    }
Exemplo n.º 7
0
        /// ------------------------------------------------------------------------------------
        private void LoadExpandedView()
        {
            _tableLayout.RowCount    = 0;
            _tableLayout.ColumnCount = 0;
            _tableLayout.RowStyles.Clear();
            _tableLayout.ColumnStyles.Clear();
            int       row           = 0;
            int       col           = 0;
            PhoneInfo prevPhoneInfo = null;

            foreach (var phoneInfo in _phonesToLoad)
            {
                var lbl = CreateLabel(phoneInfo);

                if (prevPhoneInfo == null || prevPhoneInfo.RowGroup == phoneInfo.RowGroup)
                {
                    _tableLayout.ColumnCount++;
                    _tableLayout.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize));
                }
                else
                {
                    row++;
                    col = 0;
                    _tableLayout.RowCount++;
                    _tableLayout.RowStyles.Add(new RowStyle(SizeType.AutoSize));
                }

                _tableLayout.Controls.Add(lbl, col++, row);
                prevPhoneInfo = phoneInfo;
            }

            _tableLayout.Visible = true;
        }
Exemplo n.º 8
0
        /// <summary>
        /// 返回查找的号码的信息
        /// </summary>
        /// <param name="phone"></param>
        /// <returns></returns>
        public PhoneRecord Lookup(string phone)
        {
            long      phone7;
            PhoneInfo pi = new PhoneInfo {
            };

            if (phone.Length >= 7 && phone.Length <= 11)
            {
                try
                {
                    phone7 = Convert.ToInt64(phone.Substring(0, 7));
                    if (phone7 >= 1000000 && phone7 <= 99999999999)
                    {
                        while (phone7 > 9999999)
                        {
                            phone7 /= 10;
                        }
                        pi.Phone7   = (UInt32)phone7;
                        pi.PhoneNum = phone;

                        return(FindPhone(pi));
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine("not num {0}\n", e.ToString());
                    return(new PhoneRecord {
                    });
                }
            }

            return(new PhoneRecord {
            });
        }
Exemplo n.º 9
0
        public async Task <StudentDto> ConfirmInfo(CheckStudentInfoInput input)
        {
            var student = await _repository.GetAllIncluding(a => a.Career).FirstOrDefaultAsync(a => a.EnrollCode == input.EnrollCode);

            if (student == null)
            {
                return(new StudentDto());
            }
            var uncrypt = new PasswordHasher().VerifyHashedPassword(student.Password, input.Password);

            if (uncrypt == PasswordVerificationResult.Success)
            {
                var phone = _phoneInfoRepository.FirstOrDefault(a => a.Token == input.PhoneToken);
                if (phone != null)
                {
                    phone.StudentId = student.Id;
                    await _phoneInfoRepository.UpdateAsync(phone);
                }
                else
                {
                    if (!string.IsNullOrEmpty(input.PhoneToken))
                    {
                        var newPhone = new PhoneInfo()
                        {
                            Token     = input.PhoneToken,
                            StudentId = student.Id
                        };
                        await _phoneInfoRepository.InsertOrUpdateAndGetIdAsync(newPhone);
                    }
                }
            }
            return(uncrypt == PasswordVerificationResult.Success ? MapStudent(student) : new StudentDto());
        }
Exemplo n.º 10
0
 /// <summary>
 /// Invoked by the decoding thread to indicate that it has completed.
 /// </summary>
 /// <param name="success">To indicate if the decoding process was successful.</param>
 /// <param name="postProcess">The results after post porcessing the results from record level Viterbi inference.</param>
 /// <param name="filePath">The path to the phone's memory file.</param>
 /// <param name="phoneInfo">Stores the manufacturer, model etc. information about the phone.</param>
 public void EndWork(bool success, PostProcessor postProcess, string filePath, PhoneInfo phoneInfo)
 {
     if (Terminating)
     {
         return;
     }
     if (MainForm.Program.InvokeRequired)
     {
         EndWorkCallback cb = new EndWorkCallback(EndWork);
         this.Invoke(cb, new object[] { success, postProcess, filePath, phoneInfo });
     }
     else
     {
         this.workerThread = null;
         if (success)
         {
             this.postProcess  = postProcess;
             this.filePath     = filePath;
             this.phoneInfo    = phoneInfo;
             labelStatus9.Text = String.Format("Calls={0}, Addresses={1}, SMS={2}, Images={3}",
                                               postProcess.callLogFields.Count,
                                               postProcess.addressBookFields.Count,
                                               postProcess.smsFields.Count, postProcess.imageBlocks.Count);
         }
         else
         {
             this.postProcess = null;
             HideChecksAbdSteps();
         }
         EnableDisableFields();
     }
 }
Exemplo n.º 11
0
        private void lstPhoneList_SelectedIndexChanged(object sender, EventArgs e)
        {
            selPhone = lstPhoneList.SelectedItem as PhoneInfo;
            if (selPhone != null)
            {
                tbManufacturer.Text = selPhone.Manufacturer;
                tbModel.Text        = selPhone.Model;
                tbOc.Text           = selPhone.System;
                tbMemory.Text       = selPhone.Memory.ToString();
                tbScreen.Text       = selPhone.Screen.ToString();
                tbPrice.Text        = selPhone.Price.ToString();
                try {
                    picPhoto.Image = Image.FromFile(selPhone.Photo);
                } catch (Exception) {
                    picPhoto.Image = picPhoto.ErrorImage;
                }
                tbEditManufacturer.Text = selPhone.Manufacturer;
                tbEditModel.Text        = selPhone.Model;
                tbEditSystem.Text       = selPhone.System;
                tbEditMemory.Text       = selPhone.Memory.ToString();
                tbEditScreen.Text       = selPhone.Screen.ToString();
                tbEditPrice.Text        = selPhone.Price.ToString();
                tbEditPhoto.Text        = selPhone.Photo;

                CheckedOptions(selPhone);
            }
        }
Exemplo n.º 12
0
 /// <summary>
 /// Called to initiate decoding. This is done in a separate thread.
 /// </summary>
 /// <param name="path"></param>
 /// <param name="manufacturer"></param>
 /// <param name="model"></param>
 /// <param name="note"></param>
 /// <param name="noStore"></param>
 private void StartWork(string path, string manufacturer, string model, string note, bool noStore)
 {
     this.postProcess  = null;
     this.filePath     = null;
     this.phoneInfo    = null;
     this.workerThread = new WorkerThread(path, manufacturer, model, note, noStore);
     EnableDisableFields();
     InitializeSteps();
     this.workerThread.Start();
 }
Exemplo n.º 13
0
        /// <summary>
        /// 获取机型
        /// </summary>
        /// <param name="keyword"></param>
        private void getPhones(string keyword)
        {
            mlistBrandAll.Clear();
            mlistPhoneAll.Clear();

            string strQuery = "select BrandModelID,BrandName,BrandNameEn,Model,ModelName,MobileVersion,AndroidVersion,PIC from edec_support where MarketYear <> \"" + "" + "\" ";

            if (!String.IsNullOrEmpty(keyword))
            {
                strQuery += "and BrandName like \"%" + keyword + "%\" or ModelName like \"%" + keyword + "%\" or Model like \"%" + keyword + "%\"";
            }

            DataTable dt = DatabaseUtil.Query(strQuery, mstrConnection);

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow tmpdr in dt.Rows)
                {
                    var strBrandName = tmpdr["BrandName"].ToString();

                    // 添加Phone
                    PhoneInfo newPhone = new PhoneInfo()
                    {
                        BrandModelID = tmpdr["BrandModelID"].ToString(),
                        BrandName    = tmpdr["BrandName"].ToString(),
                        ImagePath    = tmpdr["PIC"].ToString(),
                        ModelName    = tmpdr["ModelName"].ToString(),
                        BrandNameEn  = tmpdr["BrandNameEn"].ToString()
                    };
                    mlistPhoneAll.Add(newPhone);

                    // 添加Brand
                    var bi = mlistBrandAll.Where(x => x.Name == strBrandName).FirstOrDefault();
                    if (bi == null)
                    {
                        BrandInfo newBrand = new BrandInfo()
                        {
                            Name   = strBrandName,
                            NameEn = tmpdr["BrandNameEn"].ToString()
                        };
                        mlistBrandAll.Add(newBrand);
                    }
                }
            }

            this.listPhone = mlistPhoneAll.ToList();
            this.listBrand = mlistBrandAll.ToList();

            PropertyChanging("listPhone");
            PropertyChanging("listBrand");

            // 初始化选中的手机
            this.SelectedIndexPhone = -1;
        }
Exemplo n.º 14
0
        public IActionResult GetPhoneInfo(string id)
        {
            PhoneInfo phoneInfo = new PhoneInfo();

            phoneInfo = phoneInfo.GetPhoneInfo(id);

            return(Json(phoneInfo, new JsonSerializerSettings()
            {
                ContractResolver = new DefaultContractResolver()
            }));
        }
Exemplo n.º 15
0
        internal static async Task TestProgrammer(System.Threading.SynchronizationContext UIContext, string ProgrammerPath)
        {
            LogFile.BeginAction("TestProgrammer");
            try
            {
                LogFile.Log("Starting Firehose Test", LogType.FileAndConsole);

                PhoneNotifierViewModel Notifier = new();
                UIContext.Send(s => Notifier.Start(), null);
                if (Notifier.CurrentInterface == PhoneInterfaces.Qualcomm_Download)
                {
                    LogFile.Log("Phone found in emergency mode", LogType.FileAndConsole);
                }
                else
                {
                    LogFile.Log("Phone needs to be switched to emergency mode.", LogType.FileAndConsole);
                    await SwitchModeViewModel.SwitchTo(Notifier, PhoneInterfaces.Lumia_Flash);

                    PhoneInfo Info = ((NokiaFlashModel)Notifier.CurrentModel).ReadPhoneInfo();
                    Info.Log(LogType.ConsoleOnly);
                    await SwitchModeViewModel.SwitchTo(Notifier, PhoneInterfaces.Qualcomm_Download);

                    if (Notifier.CurrentInterface != PhoneInterfaces.Qualcomm_Download)
                    {
                        throw new WPinternalsException("Switching mode failed.", "Could not switch the phone to Qualcomm Emergency 9008.");
                    }

                    LogFile.Log("Phone is in emergency mode.", LogType.FileAndConsole);
                }

                // Send and start programmer
                QualcommSerial Serial = (QualcommSerial)Notifier.CurrentModel;
                QualcommSahara Sahara = new(Serial);

                if (await Sahara.Reset(ProgrammerPath))
                {
                    LogFile.Log("Emergency programmer test succeeded", LogType.FileAndConsole);
                }
                else
                {
                    LogFile.Log("Emergency programmer test failed", LogType.FileAndConsole);
                }
            }
            catch (Exception Ex)
            {
                LogFile.LogException(Ex);
            }
            finally
            {
                LogFile.EndAction("TestProgrammer");
            }
        }
        private static Variant GetVariant(PhoneInfo info)
        {
            var dict = new Dictionary <string, Variant>(StringComparer.OrdinalIgnoreCase)
            {
                { "RM-1085", Variant.SingleSim },
                { "RM-1104", Variant.SingleSim },
                { "RM-1105", Variant.SingleSim },
                { "RM-1116", Variant.DualSim },
                { "RM-1118", Variant.DualSim },
            };

            return(dict[info.Ddp.PhoneType]);
        }
Exemplo n.º 17
0
        private static void UpdatePhone(int contactId, List <string> mobiles)
        {
            if (mobiles.IsNullOrEmpty())
            {
                return;
            }
            var listPhones = PhoneRepository.GetByContact(contactId) ?? new List <PhoneInfo>();

            foreach (var mobile in mobiles
                     .Where(c => !c.IsStringNullOrEmpty())
                     .Where(c => !listPhones.Exists(p => p.PhoneNumber.Equals(c))))
            {
                if (!listPhones.Exists(c => c.PhoneType.ToInt32() == (int)PhoneType.HomePhone))
                {
                    var phone = new PhoneInfo
                    {
                        IsPrimary   = 0,
                        PhoneNumber = mobile,
                        ContactId   = contactId,
                        PhoneType   = ((int)PhoneType.HomePhone).ToString(),
                    };
                    PhoneRepository.Create(phone);
                    listPhones.Add(phone);
                }
                if (!listPhones.Exists(c => c.PhoneType.ToInt32() == (int)PhoneType.MobilePhone))
                {
                    var phone = new PhoneInfo
                    {
                        IsPrimary   = 0,
                        PhoneNumber = mobile,
                        ContactId   = contactId,
                        PhoneType   = ((int)PhoneType.MobilePhone).ToString(),
                    };
                    PhoneRepository.Create(phone);
                    listPhones.Add(phone);
                }
                if (!listPhones.Exists(c => c.PhoneType.ToInt32() == (int)PhoneType.Tel))
                {
                    var phone = new PhoneInfo
                    {
                        IsPrimary   = 0,
                        PhoneNumber = mobile,
                        ContactId   = contactId,
                        PhoneType   = ((int)PhoneType.Tel).ToString(),
                    };
                    PhoneRepository.Create(phone);
                    listPhones.Add(phone);
                }
            }
        }
Exemplo n.º 18
0
        /// <summary>
        /// Called when the user wants to open a memory file.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void toolStripButtonOpen_Click(object sender, EventArgs e)
        {
            GetMemFileDlg dlg = new GetMemFileDlg();

            if (dlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            this.filePath    = dlg.FilePath;
            this.phoneInfo   = new PhoneInfo(dlg.Manufacturer, dlg.Model, dlg.Note, dlg.DoNotStoreHashes);
            this.postProcess = null;
            HideChecksAbdSteps();
            EnableDisableFields();
        }
Exemplo n.º 19
0
        /// ------------------------------------------------------------------------------------
        public void UpdatePhoneInfoFromProjectInventory(XElement element, PhoneInfo phoneToUpdate)
        {
            if (!string.IsNullOrEmpty((string)element.Element("description")))
            {
                phoneToUpdate.Description = (string)element.Element("description");
            }

            phoneToUpdate.SetAFeatures(GetFeatureNames(element, "descriptive"));
            phoneToUpdate.SetBFeatures(GetFeatureNames(element, "distinctive"));
            phoneToUpdate.SetDefaultAFeatures(GetFeatureNames(element, "descriptive default"));
            phoneToUpdate.SetDefaultBFeatures(GetFeatureNames(element, "distinctive default"));
            phoneToUpdate.MOAKey   = GetSortKeyFromSegmentXElement(element, "manner_or_height");
            phoneToUpdate.POAKey   = GetSortKeyFromSegmentXElement(element, "place_or_backness");
            phoneToUpdate.RowGroup = GetRowGroupFromSegmentXElement(element);
        }
Exemplo n.º 20
0
        /// <summary>
        /// 利用字典数组查找 phone.dat数据库中手机号码的信息
        /// </summary>
        /// <param name="pi"></param>
        /// <returns>返回查找到的手机号码信息</returns>
        private PhoneRecord FindPhone(PhoneInfo pi)
        {
            PhoneRecord pr = new PhoneRecord();
            string      s;

            string[] strTemp;
            if (!dicBuf.ContainsKey((int)pi.Phone7))
            {
                pr.Set(pi.PhoneNum, "null", "null", "null", "null", "null");
                return(pr);
            }
            s       = dicBuf[(int)pi.Phone7];
            strTemp = s.Split(new char[] { '|' });
            pr.Set(pi.PhoneNum, strTemp[0], strTemp[1], strTemp[2], strTemp[3], GetCardType(Convert.ToByte(strTemp[4])));
            return(pr);
        }
Exemplo n.º 21
0
 private void CheckedOptions(PhoneInfo selPhone)
 {
     lstOptions.DataSource = PhoneRepository.Store.GetPhoneOptions(selPhone);
     for (int i = 0; i < chlstEditOptions.Items.Count; i++)
     {
         chlstEditOptions.SetItemChecked(i, false);
         for (int j = 0; j < selPhone.OptionsId.Count; j++)
         {
             if ((chlstEditOptions.Items[i] as Option).Id == selPhone.OptionsId[j])
             {
                 chlstEditOptions.SetItemChecked(i, true);
                 break;
             }
         }
     }
 }
 public void TearDown()
 {
     _contact      = null;
     _name         = new NameInfo();
     _organization = new OrganizationInfo();
     _phoneNumbers.ForEach(pn =>
     {
         pn = new PhoneInfo();
     });
     _phoneNumbers = null;
     _emailAddresses.ForEach(ea =>
     {
         ea = new EmailInfo();
     });
     _emailAddresses = null;
 }
Exemplo n.º 23
0
    public static PERFORMANCE_ENUM GetPerformanceType()
    {
        int   height    = Screen.height;
        uint  cpuCount  = HWInfo.getCpuCoreNumber();
        long  ram       = long.Parse(PhoneInfo.getTotalMemory()) / 1024 / 1024;
        float frequency = (float)HWInfo.getCpuMaxFre() / 1024 / 1024;

        Log.info("height : " + height);
        Log.info("cpuCount : " + cpuCount);
        Log.info("ram : " + ram);
        Log.info("frequency : " + frequency);

        if (ram >= 2500)
        {
            // 大于3g全部为中
            return(PERFORMANCE_ENUM.MIDDLE);
        }
        else
        if (ram < 1600)
        {
            // 小于2G 全部为低
            return(PERFORMANCE_ENUM.LOW);
        }

        if (cpuCount > 4)
        {
            // 4核以上为中
            return(PERFORMANCE_ENUM.MIDDLE);
        }

        // 获取硬件信息
        string hardware = PhoneInfo.getHardware();

        Log.info("hardware : " + hardware);
        foreach (string member in lowCpuSet)
        {
            if (hardware.ToLower().StartsWith(member))
            {
                // 指定低端cpu的,全部为低
                return(PERFORMANCE_ENUM.LOW);
            }
        }

        // 其他为中
        return(PERFORMANCE_ENUM.MIDDLE);
    }
Exemplo n.º 24
0
        /// <summary>
        /// 利用字典数组查找 phone.dat数据库中手机号码的信息
        /// </summary>
        /// <param name="pi"></param>
        /// <returns>返回查找到的手机号码信息</returns>
        private PhoneRecord FindPhone(PhoneInfo pi)
        {
            PhoneRecord pr = new PhoneRecord();
            string      s;

            string[] strTemp;
            // Trace.Assert(dicBuf.ContainsKey((int)pi.Phone7), $"{pi.PhoneNum} is not in phonedata");
            if (!dicBuf.ContainsKey((int)pi.Phone7))
            {
                Console.WriteLine($"{pi.PhoneNum} is not in phonedata");
                pr.Set(pi.PhoneNum, "null", "null", "null", "null", "null");
                return(pr);
            }
            s       = dicBuf[(int)pi.Phone7];
            strTemp = s.Split(new char[] { '|' });
            pr.Set(pi.PhoneNum, strTemp[0], strTemp[1], strTemp[2], strTemp[3], GetCardType(Convert.ToByte(strTemp[4])));
            return(pr);
        }
        public void ShouldSubstituteMappedTypeOnSerialize()
        {
            // Arrange
            var nameAndTypeMappings = new NameAndTypeMappings();
            var serializer          = new StringSerializer(nameAndTypeMappings: nameAndTypeMappings);

            // Act
            var input = new PhoneInfo
            {
                Name = "Sarel"
            };

            nameAndTypeMappings.MapTermNameToType <PhoneInfo>("ContactInfoRenamed");
            var output = serializer.Serialize(input);

            // Assert
            Assert.True(StringComparer.InvariantCulture.Equals("root: ContactInfoRenamed(null,\"Sarel\");", output));
        }
        public void ShouldUseLongestDeconstructorToCreateNonAcTermForNonExtensionMethod()
        {
            // Arrange
            var nameAndTypeMappings = new NameAndTypeMappings();
            var serializer          = new StringSerializer(nameAndTypeMappings: nameAndTypeMappings);
            var input = new PhoneInfo
            {
                Name        = "Test T",
                PhoneNumber = "1234567890"
            };

            // Act
            nameAndTypeMappings.MapTermNameToType <PhoneInfo>("phone");
            var output = serializer.Serialize(input);

            // Assert
            Assert.Equal("root: phone(\"1234567890\",\"Test T\");", output);
        }