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

C# EmailAddress类代码示例

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

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



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

示例1: CreateNewMeeting

        public async Task CreateNewMeeting()
        {
            try
            {
                Microsoft.Graph.Event evt = new Microsoft.Graph.Event();

                Location location = new Location();
                location.DisplayName = tbLocation.Text;

                ItemBody body = new ItemBody();
                body.Content = tbBody.Text;
                body.ContentType = BodyType.Html;

                List<Attendee> attendees = new List<Attendee>();
                Attendee attendee = new Attendee();
                EmailAddress email = new EmailAddress();
                email.Address = tbToRecipients.Text;
                attendee.EmailAddress = email;
                attendee.Type = AttendeeType.Required;
                attendees.Add(attendee);

                evt.Subject = tbSubject.Text;
                evt.Body = body;
                evt.Location = location;
                evt.Attendees = attendees;

                DateTimeTimeZone dtStart = new DateTimeTimeZone();
                dtStart.TimeZone = TimeZoneInfo.Local.Id;
                DateTime dts = dtpStartDate.Value.Date + dtpStartTime.Value.TimeOfDay;
                dtStart.DateTime = dts.ToString();
                
                DateTimeTimeZone dtEnd = new DateTimeTimeZone();
                dtEnd.TimeZone = TimeZoneInfo.Local.Id;
                DateTime dte = dtpEndDate.Value.Date + dtpEndTime.Value.TimeOfDay;
                dtEnd.DateTime = dte.ToString();

                evt.Start = dtStart;
                evt.End = dtEnd;
                
                // log the request info
                sdklogger.Log(graphClient.Me.Events.Request().GetHttpRequestMessage().Headers.ToString());
                sdklogger.Log(graphClient.Me.Events.Request().GetHttpRequestMessage().RequestUri.ToString());

                // send the new message
                var createdEvent = await graphClient.Me.Events.Request().AddAsync(evt);

                // log the send and associated id
                sdklogger.Log("Meeting Sent : Id = " + createdEvent.Id);
            }
            catch (Exception ex)
            {
                sdklogger.Log("NewMeetingSend Failed: " + ex.Message);
                sdklogger.Log(ex.Message);
            }
            finally
            {
                // close the form
                Close();
            }
        }
开发者ID:desjarlais,项目名称:restfuloutlook,代码行数:60,代码来源:NewEventForm.cs


示例2: EmailAddress_TwoAddressesDifferentValue_AreNotEqual

        public void EmailAddress_TwoAddressesDifferentValue_AreNotEqual()
        {
            var address = new EmailAddress("[email protected]", "test");
            var address2 = new EmailAddress("[email protected]", "test");

            Assert.IsTrue(address != address2);
        }
开发者ID:philhouston,项目名称:DDDSample,代码行数:7,代码来源:EmailAddressTests.cs


示例3: CheckAccess

        /// <summary>
        /// Checks the access an account has with an organization..
        /// </summary>
        /// <param name="name">The organization name.</param>
        /// <param name="accountId">The account identifier.</param>
        /// <param name="allowAdmin">if set to <c>true</c> allow admin.</param>
        /// <param name="allowWrite">if set to <c>true</c> allow write.</param>
        /// <param name="allowRead">if set to <c>true</c> allow read.</param>
        public void CheckAccess(
            DomainLabel name,
            EmailAddress accountId,
            out bool allowAdmin,
            out bool allowWrite,
            out bool allowRead)
        {
            allowAdmin = false;
            allowWrite = false;
            allowRead = false;

            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            if (accountId == null)
            {
                throw new ArgumentNullException("accountId");
            }

            CloudTable orgMemberTable = this.GetOrganizationMembershipTable();
            TableOperation getOrgMember = TableOperation.Retrieve<OrganizationMembershipEntity>(
                name.ToString(),
                accountId.ToString());
            TableResult result = orgMemberTable.Execute(getOrgMember);
            OrganizationMembershipEntity entity = result.Result as OrganizationMembershipEntity;
            if (entity != null)
            {
                allowRead = true;
                allowWrite = entity.AllowWrite;
                allowAdmin = entity.AllowAdmin;
            }
        }
开发者ID:localtoast9001,项目名称:independent-sts,代码行数:42,代码来源:OrganizationStore.cs


示例4: EmailAddress_TwoAddressesSameValue_AreEqual

        public void EmailAddress_TwoAddressesSameValue_AreEqual()
        {
            var address = new EmailAddress("[email protected]", "test");
            var address2 = new EmailAddress("[email protected]", "test");

            Assert.IsTrue(address == address2);
        }
开发者ID:philhouston,项目名称:DDDSample,代码行数:7,代码来源:EmailAddressTests.cs


示例5: ActivateAccount

        /// <summary>
        /// Activates the given account if it is not already activated.
        /// </summary>
        /// <param name="accountId">the account to activate.</param>
        public void ActivateAccount(
            EmailAddress accountId)
        {
            CloudTable loginTable = this.GetLoginTable();
            CloudTable accountTable = this.GetAccountTable();

            LoginEntity existingEntity = FindExistingLogin(loginTable, accountId);
            AccountEntity existingAccount = FindExistingAccount(accountTable, accountId);
            if (existingEntity == null || existingAccount == null)
            {
                throw new InvalidOperationException("Account does not exist.");
            }

            if (existingEntity.Activated)
            {
                return;
            }

            existingAccount.ActivatedTime = DateTime.UtcNow;
            existingEntity.Activated = true;
            TableOperation updateAccountOperation = TableOperation.Replace(existingAccount);
            accountTable.Execute(updateAccountOperation);
            TableOperation updateLoginOperation = TableOperation.Replace(existingEntity);
            loginTable.Execute(updateLoginOperation);
        }
开发者ID:localtoast9001,项目名称:independent-sts,代码行数:29,代码来源:AccountStore.cs


示例6: Create

 public ActionResult Create(EmailAddress Model)
 {
     return Dispatcher.Create(
         DataModel: Model,
         SuccessResult: m => ModalRedirectToLocal(Url.Action("Index", "Settings", new { Area = "Account" }, null)),
         InvalidResult: m => PartialView(m));
 }
开发者ID:skankydog,项目名称:fido,代码行数:7,代码来源:EmailAddressController.cs


示例7: Equals_SameAddressAndNullTypes_AreEqual

        public void Equals_SameAddressAndNullTypes_AreEqual()
        {
            var emailAddress1 = new EmailAddress("[email protected]", null);
            var emailAddress2 = new EmailAddress("[email protected]", null);

            Assert.Equal(emailAddress1, emailAddress2);
        }
开发者ID:NGPVAN,项目名称:osdi.net,代码行数:7,代码来源:EmailAddressTests.cs


示例8: Equals_SameAddressAndSameTypes_AreEqual

        public void Equals_SameAddressAndSameTypes_AreEqual()
        {
            var emailAddress1 = new EmailAddress("[email protected]", EmailAddressType.Personal);
            var emailAddress2 = new EmailAddress("[email protected]", EmailAddressType.Personal);

            Assert.Equal(emailAddress1, emailAddress2);
        }
开发者ID:NGPVAN,项目名称:osdi.net,代码行数:7,代码来源:EmailAddressTests.cs


示例9: AccountRegistration

 public AccountRegistration(Username username, Password password, FullName fullName, EmailAddress email)
 {
     Email = email;
     Username = username;
     Password = password;
     FullName = fullName;
 }
开发者ID:rgavrilov,项目名称:thcard,代码行数:7,代码来源:AccountRegistration.cs


示例10: Equals_DifferentAddressesAndNullTypes_AreNotEqual

        public void Equals_DifferentAddressesAndNullTypes_AreNotEqual()
        {
            var emailAddress1 = new EmailAddress("[email protected]", null);
            var emailAddress2 = new EmailAddress("[email protected]", null);

            Assert.NotEqual(emailAddress1, emailAddress2);
        }
开发者ID:NGPVAN,项目名称:osdi.net,代码行数:7,代码来源:EmailAddressTests.cs


示例11: Equals_SameAddressAndOneNullType_AreNotEqual

        public void Equals_SameAddressAndOneNullType_AreNotEqual()
        {
            var emailAddress1 = new EmailAddress("[email protected]", null);
            var emailAddress2 = new EmailAddress("[email protected]", EmailAddressType.Work);

            Assert.NotEqual(emailAddress1, emailAddress2);
        }
开发者ID:NGPVAN,项目名称:osdi.net,代码行数:7,代码来源:EmailAddressTests.cs


示例12: Equals_SameAddressAndDifferentTypes_AreNotEqual

        public void Equals_SameAddressAndDifferentTypes_AreNotEqual()
        {
            var emailAddress1 = new EmailAddress("[email protected]", EmailAddressType.Personal);
            var emailAddress2 = new EmailAddress("[email protected]", EmailAddressType.Work);

            Assert.NotEqual(emailAddress1, emailAddress2);
        }
开发者ID:NGPVAN,项目名称:osdi.net,代码行数:7,代码来源:EmailAddressTests.cs


示例13: EqualsOperator

        public void EqualsOperator()
        {
            var email1 = new EmailAddress("[email protected]");
            var email2 = new EmailAddress("[email protected]");

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


示例14: ComposeRepairCompletedEmailMessage

        public async Task<Message> ComposeRepairCompletedEmailMessage(int incidentId)
        {
            var incident = await GetIncident(incidentId);
            var attachments = await GetInspectionOrRepairPhotosAsAttachments("Room Inspection Photos", incident.sl_inspectionID.Id, incident.sl_roomID.Id);

            var property = incident.sl_propertyID;

            var propertyOwnerRecipientEmail = new EmailAddress { Address = property.sl_emailaddress, Name = property.sl_owner };
            var dispacherRecipientEmail = new EmailAddress { Address = DispatcherEmail, Name = DispatcherName };

            var bodyTemplate = System.IO.File.ReadAllText(bodyTemplateFile);
            var viewBag = new RazorEngine.Templating.DynamicViewBag();
            viewBag.AddValue("InspectionPhotosAttachments", attachments);
            var body = RazorEngine.Razor.Parse(bodyTemplate, incident, viewBag, "EmailBody");

            var message = new Message
            {
                Subject = string.Format("Repair Report - {0} - {1:MM/dd/yyyy}", property.Title, DateTime.UtcNow),
                Importance = Importance.Normal,
                Body = new ItemBody
                {
                    ContentType = BodyType.HTML,
                    Content = body
                },
            };
            message.ToRecipients.Add(new Recipient { EmailAddress = propertyOwnerRecipientEmail });
            message.CcRecipients.Add(new Recipient { EmailAddress = dispacherRecipientEmail });
            foreach (var attachment in attachments)
                message.Attachments.Add(attachment);

            return message;
        }
开发者ID:rajendra1809,项目名称:Property-Inspection-Code-Sample,代码行数:32,代码来源:EmailService.cs


示例15: CreateSystemAccount

        /// <summary>
        /// Creates the system account.
        /// </summary>
        /// <param name="identifier">The identifier.</param>
        /// <param name="displayName">The display name.</param>
        /// <param name="emailAddress">The email address.</param>
        /// <param name="identityProviderName">Name of the identity provider.</param>
        /// <param name="identityProviderUri">The identity provider URI.</param>
        /// <returns>
        /// A SystemAccount.
        /// </returns>
        public SystemAccount CreateSystemAccount(string identifier, string displayName, EmailAddress emailAddress, string identityProviderName, string identityProviderUri   )
        {
            var account = new SystemAccount ( identifier, displayName, emailAddress, identityProviderName, identityProviderUri );
            _repository.MakePersistent ( account );

            return account;
        }
开发者ID:divyang4481,项目名称:REM,代码行数:18,代码来源:SystemAccountFactory.cs


示例16: OAuth2Code

 /// <summary>
 /// Initializes a new instance of the <see cref="OAuth2Code"/> class.
 /// </summary>
 /// <param name="accountId">The account identifier.</param>
 /// <param name="applicationName">Name of the application.</param>
 /// <param name="expires">The expires.</param>
 /// <param name="hash">The hash.</param>
 private OAuth2Code(EmailAddress accountId, DomainLabel applicationName, DateTime expires, byte[] hash)
     : base(hash)
 {
     this.accountId = accountId;
     this.applicationName = applicationName;
     this.expires = expires;
 }
开发者ID:localtoast9001,项目名称:independent-sts,代码行数:14,代码来源:OAuth2Code.cs


示例17: EqualsMethod

        public void EqualsMethod()
        {
            var email1 = new EmailAddress("[email protected]");
            var email2 = new EmailAddress("[email protected]");

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


示例18: Handler_ReturnsNullUser_WhenFound_ByUnverifiedEmail

        public void Handler_ReturnsNullUser_WhenFound_ByUnverifiedEmail()
        {
            var nameOrEmail = FakeData.Email();
            var query = new UserByNameOrVerifiedEmail(nameOrEmail);
            var queries = new Mock<IProcessQueries>(MockBehavior.Strict);
            Expression<Func<UserBy, bool>> expectedUserQuery =
                x => x.Name == nameOrEmail;
            queries.Setup(x => x.Execute(It.Is(expectedUserQuery)))
                .Returns(Task.FromResult(null as User));
            var user = new User { Name = FakeData.String(), };
            var emailAddress = new EmailAddress
            {
                Value = nameOrEmail,
                UserId = user.Id,
                User = user,
                IsVerified = false,
            };
            Expression<Func<EmailAddressBy, bool>> expectedEmailQuery =
                x => x.Value == nameOrEmail && x.IsVerified == true;
            queries.Setup(x => x.Execute(It.Is(expectedEmailQuery)))
                .Returns(Task.FromResult(emailAddress));
            var handler = new HandleUserByNameOrVerifiedEmailQuery(queries.Object);

            User result = handler.Handle(query).Result;

            result.ShouldBeNull();
            queries.Verify(x => x.Execute(It.Is(expectedUserQuery)), Times.Once);
            queries.Verify(x => x.Execute(It.Is(expectedEmailQuery)), Times.Once);
        }
开发者ID:phobos04,项目名称:tripod,代码行数:29,代码来源:UserByNameOrVerifiedEmailTests.cs


示例19: LocationEmailAddress

        /// <summary>
        /// Initializes a new instance of the <see cref="LocationEmailAddress"/> class.
        /// </summary>
        /// <param name="emailAddress">
        /// The email address.
        /// </param>
        /// <param name="emailAddressType">
        /// The email address type.
        /// </param>
        public LocationEmailAddress(EmailAddress emailAddress, LocationEmailAddressType emailAddressType)
        {
            Check.IsNotNull(emailAddress, () => EmailAddress);
            Check.IsNotNull(emailAddressType, () => LocationEmailAddressType);

            _emailAddress = emailAddress;
            _locationEmailAddressType = emailAddressType;
        }
开发者ID:divyang4481,项目名称:REM,代码行数:17,代码来源:LocationEmailAddress.cs


示例20: ContactInformation

 public ContactInformation(EmailAddress emailAddress, PostalAddress postalAddress, Telephone primaryTelephone,
     Telephone secondaryTelephone)
 {
     this.EmailAddress = emailAddress;
     this.PostalAddress = postalAddress;
     this.PrimaryTelephone = primaryTelephone;
     this.SecondaryTelephone = secondaryTelephone;
 }
开发者ID:ZhangColin,项目名称:IDDD_Samples_by_Colin,代码行数:8,代码来源:ContactInformation.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# EmailComposeTask类代码示例发布时间:2022-05-24
下一篇:
C# Email类代码示例发布时间: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