Share via


CrmConnectionManager Class

Definition

Provides Connection logic and error handling for connecting to CRM2011. This class is designed to operate in the background, off the primary user UI thread. This class raises events that can be used to update the user with progress reports.

public ref class CrmConnectionManager : IDisposable
public class CrmConnectionManager : IDisposable
type CrmConnectionManager = class
    interface IDisposable
Public Class CrmConnectionManager
Implements IDisposable
Inheritance
CrmConnectionManager
Implements

Constructors

CrmConnectionManager()

Default constructor.

Properties

ClientId

ClientId for the client

ConnectedOrgFriendlyName

Returns the friendly name of the connected org.

ConnectedOrgId

Returns the unique Id of the connected organization.

ConnectedOrgPublishedEndpoints

Returns the endpoint collection for the connected org.

ConnectedOrgUniqueName

Returns the unique name for the org that has been connected.

CrmOnlineDiscoveryServerList

Collection of CRM Discovery Servers if a server list has not been submitted to this property, and get is called, a new instance of the CrmOnlineDiscoveryServers is created.

CrmOrgsFoundForUser

List of Organizations that have been requested by the user.

CrmSvc

CRM Connection Object.

ForceFirstOAuthPrompt

Forces an OAuth Prompt on the first request for this connection.

HomeRealmServersList

Collection of HomeRealms Loaded by Configuration

HostApplicatioNameOveride

Used in conjunction with the UseUserLocalDirecotryForConfigStore, Allows you to set a name for the config application to use. This is used when the host application cannot provide a proper AppDomain.Current.FriendlyName

LastError

last error from the connection manager

LastException

Last Exception from the connection manager.

ParentControl

This the parent control that invoked me.

ProfileName

Profile name to use for this login process.

RedirectUri

Resource for the resource

TokenCachePath

Token Cache Path where tokencache file will be stored.

UserId

User Identifier as a login hint

UseUserLocalDirectoryForConfigStore

Tells the system to store the user config in the users local app directory instead of the Exe directory.

Methods

CancelConnectToServerCheck()

Cancel Connection process.

ConnectToServerCheck()

Begins the authentication process for CRM.

ConnectToServerCheck(CrmOrgByServer)

Begin Connect check to server

Dispose()

Clean up

Dispose(Boolean)

Clean up

Finalize()

Clean up background worker on exit.

LoadConfigFromFile(Boolean)

Loads the Configuration key's from file b/c some things are missing

RemoveUserLocalDirectoryConfigFile()

Will remove the user connection data settings from the users app config directory, useable only when the UseUserLocalDirectoryForConfigStore is set to true. this should be called after the connection has been established, or before the connect attempt in order to be effective.

RequireUserLogin()

This will check the configuration to determine if a user login is required. and if so, return true.

SaveConfigToFile(Dictionary<Dynamics_ConfigFileServerKeys,Object>)

Save the configuration Keys to the configuration file.

SetConfigKeyInformation(Dictionary<Dynamics_ConfigFileServerKeys,Object>)

Sets the current connection information for the server.

this can be used to pass in a preconfigured list of keys

Events

ConnectionCheckComplete

Raised when the connection process completes

ServerConnectionStatusUpdate

Raised when a status is updated

Applies to