当前位置: 首页>>代码示例>>C#>>正文


C# PhoneNumber类代码示例

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


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

示例1: AddClient

 public void AddClient(PhoneNumber phoneNumber, ITariff tariff)
 {
     _tariffsMap.Add(phoneNumber, tariff);
     _canChangeTariffMap.Add(phoneNumber, true);
     _callsMap.Add(phoneNumber, new List<CallInfo>());
     _debtMap.Add(phoneNumber, 0);
 }
开发者ID:SergeyKononovich,项目名称:EpamTraining,代码行数:7,代码来源:TestBillingSystem.cs

示例2: SetTerminalsStateTo

 private void SetTerminalsStateTo(PhoneNumber source, PhoneNumber target, TerminalState state)
 {
     var sourceTerminal = GetTerminalByPhoneNumber(source) as TestTerminal;
     var targetTerminal = GetTerminalByPhoneNumber(target) as TestTerminal;
     if (sourceTerminal != null) sourceTerminal.State = state;
     if (targetTerminal != null) targetTerminal.State = state;
 }
开发者ID:Demenovich-A-J,项目名称:ATS,代码行数:7,代码来源:Ats.cs

示例3: TestTerminal

 public TestTerminal(PhoneNumber number)
     : base(number)
 {
     this.IncomingRequest += this.OnIncomingRequest;
     this.Online += (sender, args) => { Console.WriteLine("Terminal {0} turned to online mode", Number); };
     this.Offline += (sender, args) => { Console.WriteLine("Terminal {0} turned to offline mode", Number); };
 }
开发者ID:Kesha85,项目名称:EPAM_Spring_Training_2015,代码行数:7,代码来源:TestTerminal.cs

示例4: Post

        /// <summary>
        /// Posts the specified phone number.
        /// </summary>
        /// <param name="phoneNumber">The phone number.</param>
        /// <returns></returns>
        public override System.Net.Http.HttpResponseMessage Post( PhoneNumber phoneNumber )
        {
            var changes = new List<string>();
            string newPhoneNumber = phoneNumber.NumberFormattedWithCountryCode;
            History.EvaluateChange(
                changes,
                string.Format( "{0} Phone", DefinedValueCache.GetName( phoneNumber.NumberTypeValueId ) ),
                string.Empty,
                newPhoneNumber );

            var rockContext = (RockContext)Service.Context;

            System.Web.HttpContext.Current.Items.Add( "CurrentPerson", GetPerson() );

            int? modifiedByPersonAliasId = phoneNumber.ModifiedAuditValuesAlreadyUpdated ? phoneNumber.ModifiedByPersonAliasId : (int?)null;

            HistoryService.SaveChanges(
                rockContext,
                typeof( Person ),
                Rock.SystemGuid.Category.HISTORY_PERSON_DEMOGRAPHIC_CHANGES.AsGuid(),
                phoneNumber.PersonId,
                changes,
                true,
                modifiedByPersonAliasId );

            return base.Post( phoneNumber );
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:32,代码来源:PhoneNumbersController.Partial.cs

示例5: Person

 public Person()
 {
     Adresse = new Address();
     Telefon = new PhoneNumber();
     Rights = new Rights();
     ID = Guid.NewGuid();
 }
开发者ID:apazureck,项目名称:bierstrichler,代码行数:7,代码来源:Person.cs

示例6: Insert

 ///<summary>Inserts one PhoneNumber into the database.  Returns the new priKey.</summary>
 internal static long Insert(PhoneNumber phoneNumber)
 {
     if(DataConnection.DBtype==DatabaseType.Oracle) {
         phoneNumber.PhoneNumberNum=DbHelper.GetNextOracleKey("phonenumber","PhoneNumberNum");
         int loopcount=0;
         while(loopcount<100){
             try {
                 return Insert(phoneNumber,true);
             }
             catch(Oracle.DataAccess.Client.OracleException ex){
                 if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){
                     phoneNumber.PhoneNumberNum++;
                     loopcount++;
                 }
                 else{
                     throw ex;
                 }
             }
         }
         throw new ApplicationException("Insert failed.  Could not generate primary key.");
     }
     else {
         return Insert(phoneNumber,false);
     }
 }
开发者ID:nampn,项目名称:ODental,代码行数:26,代码来源:PhoneNumberCrud.cs

示例7: EqualsOperator

        public void EqualsOperator()
        {
            var phoneNumber1 = new PhoneNumber("01234 567890");
            var phoneNumber2 = new PhoneNumber("01234 567890");

            Assert.True(phoneNumber1 == phoneNumber2);
        }
开发者ID:EnvironmentAgency,项目名称:prsd-iws,代码行数:7,代码来源:PhoneNumberTests.cs

示例8: TestEquality

 public void TestEquality()
 {
     var phone1 = new PhoneNumber("2055551212");
     Assert.AreEqual(phone1, phone1);
     var phone2 = new PhoneNumber("2055551212");
     Assert.AreEqual(phone1, phone2);
 }
开发者ID:rickeygalloway,项目名称:Test,代码行数:7,代码来源:TestPhoneNumber.cs

示例9: EqualsMethod

        public void EqualsMethod()
        {
            var phoneNumber1 = new PhoneNumber("01234 567890");
            var phoneNumber2 = new PhoneNumber("01234 567890");

            Assert.True(phoneNumber1.Equals(phoneNumber2));
        }
开发者ID:EnvironmentAgency,项目名称:prsd-iws,代码行数:7,代码来源:PhoneNumberTests.cs

示例10: Call

 public virtual void Call(PhoneNumber target)
 {
     if (IsOnline)
     {
         OnOutgoingCall(this, new CallInfo(target, Number, TerminalState.OutGoingCall));
     }
 }
开发者ID:Demenovich-A-J,项目名称:ATS,代码行数:7,代码来源:Terminal.cs

示例11: MessageRequest

        public MessageRequest(PhoneNumber sender, string message)
        {
            if (message == null) throw new ArgumentNullException(nameof(message));

            Sender = sender;
            Message = message;
        }
开发者ID:SergeyKononovich,项目名称:EpamTraining,代码行数:7,代码来源:MessageRequest.cs

示例12: NumericPhoneNumberWithWhiteSpaces

        public void NumericPhoneNumberWithWhiteSpaces()
        {
            const string phoneNumber = "02 588 4430";

            sut = PhoneNumber.Create(phoneNumber);

            Assert.AreEqual(phoneNumber, sut.ToString());
        }
开发者ID:affecto,项目名称:dotnet-Identifiers.Finnish,代码行数:8,代码来源:PhoneNumberTests.cs

示例13: NumericPhoneNumber

        public void NumericPhoneNumber()
        {
            const string phoneNumber = "0100100";

            sut = PhoneNumber.Create(phoneNumber);

            Assert.AreEqual(phoneNumber, sut.ToString());
        }
开发者ID:affecto,项目名称:dotnet-Identifiers.Finnish,代码行数:8,代码来源:PhoneNumberTests.cs

示例14: USPhoneNumber

 public void USPhoneNumber()
 {
     var phoneNumber = new PhoneNumber("8015461234");
     Assert.Equal("801", phoneNumber.AreaCode);
     Assert.Equal("546", phoneNumber.Prefix);
     Assert.Equal("1234", phoneNumber.Postfix);
     Assert.Equal("(801) 546-1234", phoneNumber.Formatted);
 }
开发者ID:SharpSeeEr,项目名称:SharpNET.Utilities,代码行数:8,代码来源:PhoneNumberTest.cs

示例15: Constructor_OnlyDigits_SetsNumber

        public void Constructor_OnlyDigits_SetsNumber()
        {
            string number = "5555555555";

            var phoneNumber = new PhoneNumber(number);

            Assert.Equal(number, phoneNumber.Number);
        }
开发者ID:NGPVAN,项目名称:osdi.net,代码行数:8,代码来源:PhoneNumberTests.cs


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