Partager via


HostedEmailServiceInfo Class

 

Describes a hosted email service.

Namespace:   Microsoft.WindowsServerSolutions.HostedEmail
Assembly:  Wssg.HostedEmailObjectModel (in Wssg.HostedEmailObjectModel.dll)

Inheritance Hierarchy

System.Object
  Microsoft.WindowsServerSolutions.HostedEmail.HostedEmailServiceInfo

Syntax

public class HostedEmailServiceInfo
public ref class HostedEmailServiceInfo 
Public Class HostedEmailServiceInfo

Constructors

Name Description
System_CAPS_pubmethod HostedEmailServiceInfo()

Creates a new instance of the HostedEmailServiceInfo object.

Properties

Name Description
System_CAPS_pubproperty FullName

Retrieves the full name of a hosted email service.

System_CAPS_pubproperty LogoImagePath

Retrieves the directory path to the logo image for a hosted email service.

System_CAPS_pubproperty Provider

Retrieves the information for the provider associated with the hosted email service.

System_CAPS_pubproperty RetrievePasswordUrl

Retrieves the URL used to retrieve the admin password for the hosted email service.

System_CAPS_pubproperty ServiceDescription

Retrieves a description of the service.

System_CAPS_pubproperty ServiceSignUpUrl

Retrieves the URL used for signing up a user to the hosted email service.

System_CAPS_pubproperty ServiceUserPortal

Retrieves the main entry URL for users to access the hosted email service.

System_CAPS_pubproperty ShortName

Retrieves the short name for the hosted email service.

System_CAPS_pubproperty SupportContact

Retrieves the contact information for the hosted email service.

Methods

Name Description
System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)

Examples

The following code describes loading the HostedEmailServiceInfo in order to display the information to the user. For the complete sample, see Quickstart: Quickstart: Creating a Hosted Email Adapter.

private void LoadIntegratedOrUnintegratedForm()
        {
            this.SuspendLayout();

            Uri serviceWebsite = new Uri(Resources.ContosoServices_DefaultWebUrl);
            string phoneNumber = Resources.ContosoServices_DefaultPhoneNumber;
            string supportEmail = Resources.ContosoServices_DefaultSupportEmail;
            string companyName = Resources.ContosoServices_DefaultCompanyName;
            string serviceName = Resources.ContosoServices_DefaultServiceName;

            if (!ContosoEmailEnabled)
            {
                tableLayoutPanelIntegration.Visible = false;
                tableLayoutPanelNotIntegration.Visible = true;
                tableLayoutPanelSubscription.Visible = false;

                //set tableLayoutPanelIntegration's ColumnStyle to AutoSize, so it could auto-hide.
                int colPosition = tableLayoutPanelTop.GetColumn(tableLayoutPanelIntegration);
                tableLayoutPanelTop.ColumnStyles[colPosition].SizeType = SizeType.AutoSize;

                tableLayoutPanelTop.Controls.Remove(tableLayoutPanelIntegration);
                tableLayoutPanelTop.Controls.Remove(tableLayoutPanelSubscription);
            }
            else
            {
                tableLayoutPanelIntegration.Visible = true;
                tableLayoutPanelNotIntegration.Visible = false;
                tableLayoutPanelSubscription.Visible = true;

                //set tableLayoutPanelNotIntegration's ColumnStyle to AutoSize, so it could auto-hide.
                int colPosition = tableLayoutPanelTop.GetColumn(tableLayoutPanelNotIntegration);
                tableLayoutPanelTop.ColumnStyles[colPosition].SizeType = SizeType.AutoSize;
                tableLayoutPanelTop.Controls.Remove(tableLayoutPanelNotIntegration);

                labelSigninAccount.Text = Resources.ContosoServices_DefaultAdminAccount;
                try
                {
                    HostedEmailServiceInfo info = HostedEmailIntegrationManager.Configuration.Service;
                    if (info != null)
                    {
                        HostedEmailSupportContactInfo ContosoEmailSupport = info.SupportContact;
                        if (ContosoEmailSupport != null)
                        {
                            phoneNumber = ContosoEmailSupport.PhoneNumber;
                            supportEmail = ContosoEmailSupport.EmailAddress;
                        }
                        if (info.Provider.Name != null)
                        {
                            companyName = info.Provider.Name;
                            serviceWebsite = info.Provider.Website;
                        }
                        if (info.ShortName != null)
                        {
                            serviceName = info.ShortName;
                        }
                        if (CredentialManager.AdminUserName != null)
                        {
                            labelSigninAccount.Text = CredentialManager.AdminUserName;
                        }
                    }

                }
                catch (Exception)
                {
                    //Do nothing, use default value.
                }

                //Show notice for users when addin retrieving data
                UpdateDomains(true, false);
                UpdateMailBoxNumber(true, false);

                //retrieving data
                ThreadPool.QueueUserWorkItem((state) =>
                {
                    if (manager.Connect())
                    {
                        Manager_ConnectCompleted();
                    }
                    else
                    {
                        Manager_ConnectFailed();
                    }
                });
            }

            dashboardLinkLabelContosoURL.LinkUrl = serviceWebsite;
            dashboardLinkLabelContosoURL.Text = serviceWebsite.ToString();
            labelPhoneNumber.Text = phoneNumber;
            labelCompanyName.Text = companyName;
            dashboardLinkLabelContosoEmail.Text = supportEmail;
            dashboardLinkLabelContosoEmail.LinkUrl = new Uri("mailto:" + supportEmail);
            if (ContosoEmailEnabled)
            {
                labelServerIsIntegratedDescription.Text = string.Format(CultureInfo.CurrentCulture, Resources.ContosoServices_IntegratedDescription, serviceName);
            }
            else
            {
                labelServerNotIntegratedDescription.Text = string.Format(CultureInfo.CurrentCulture, Resources.ContosoServices_NotIntegratedDescription, serviceName);
            }

            this.ResumeLayout();
        }

Thread Safety

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Microsoft.WindowsServerSolutions.HostedEmail Namespace

Return to top