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


C# EmailAddress类代码示例

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


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


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