• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# PhoneNumber类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Contract

 public Contract(string number, string phoneNumber, TariffPlan tariffPlan, string personalAccount, string dateOfConclusion)
 {
     Number = number;
     PhoneNumber = new PhoneNumber { Value = phoneNumber };
     TariffPlan = tariffPlan;
     DateOfConclusion = DateTime.Parse(dateOfConclusion);
     PersonalAccount = new PersonalAccount(personalAccount, DateOfConclusion + new TimeSpan(31, 0, 0));
 }
开发者ID:andrewtovkach,项目名称:EpamTraining,代码行数:8,代码来源:Contract.cs


示例17: CreateAttendee

 private static EventAttendee CreateAttendee(string firstName, string lastName)
 {
     var name = new PersonName(firstName, lastName);
     var email = new EmailAddress("[email protected]");
     var phone = new PhoneNumber("2055551212");
     var address = new Address("123 Main St.", "Suite 1", "Los Angeles", 10, "90036");
     return new EventAttendee(name, address, email, phone, firstName, lastName);
 }
开发者ID:rickeygalloway,项目名称:Test,代码行数:8,代码来源:TestEventOccurrenceAttendee.cs


示例18: Call

 public void Call(PhoneNumber target)
 {
     if (!IsOnline)
     {
         OnOutgoingCall(this, target);
         OnOnline(this, null);
     }
 }
开发者ID:Kesha85,项目名称:EPAM_Spring_Training_2015,代码行数:8,代码来源:Terminal.cs


示例19: Terminal

 public Terminal(PhoneNumber number,string name,TariffPlans rate)
 {
     this.Number = number;
        this.UserName = name;
        this.CurrentTariff = rate;
        this.DateOfTariffChange = DateTime.Now;
        this.AllowChangeTariff = false;
 }
开发者ID:newLink01,项目名称:ForEPAM,代码行数:8,代码来源:Terminal.cs


示例20: SpeakerDocument

 public SpeakerDocument(Id id, Version version, SpeakerBio bio, PhoneNumber phoneNumber, EmailAddress emailAddress, Name name)
 {
     Bio = (string) bio;
     Email = (string) emailAddress;
     Id = (Guid) id;
     PhoneNumber = (string) phoneNumber;
     Name = (string) name;
     Version = (int)version;
 }
开发者ID:johnnonolan,项目名称:Paramore,代码行数:9,代码来源:SpeakerDocument.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Photo类代码示例发布时间:2022-05-24
下一篇:
C# PhoneCallTask类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap