Amazon.MobileAnalytics.MobileAnalyticsManager.MobileAnalyticsManager.GetOrCreateInstance C# (CSharp) Method

GetOrCreateInstance() public static method

Gets or creates Mobile Analytics Manager instance. If the instance already exists, returns the instance; otherwise creates new instance and returns it.
public static GetOrCreateInstance ( string appID, AWSCredentials credentials, RegionEndpoint regionEndpoint ) : MobileAnalyticsManager
appID string Amazon Mobile Analytics Application ID.
credentials Amazon.Runtime.AWSCredentials AWS Credentials.
regionEndpoint RegionEndpoint Region endpoint.
return MobileAnalyticsManager
        public static MobileAnalyticsManager GetOrCreateInstance(string appID, AWSCredentials credentials, RegionEndpoint regionEndpoint)
        {
            if (string.IsNullOrEmpty(appID))
                throw new ArgumentNullException("appID");
            if (null == credentials)
                throw new ArgumentNullException("credentials");
            if (null == regionEndpoint)
                throw new ArgumentNullException("regionEndpoint");

            MobileAnalyticsManagerConfig maConfig = new MobileAnalyticsManagerConfig();
            return GetOrCreateInstanceHelper(appID, credentials, regionEndpoint, maConfig);
        }

Same methods

MobileAnalyticsManager::GetOrCreateInstance ( string appID, AWSCredentials credentials, RegionEndpoint regionEndpoint, MobileAnalyticsManagerConfig maConfig ) : MobileAnalyticsManager

Usage Example

コード例 #1
0
        /// <summary>
        /// Gets the or creates Mobile Analytics Manager instance. If the instance already exists, returns the instance; otherwise
        /// creates new instance and returns it.
        /// </summary>
        /// <returns>Mobile Analytics Manager instance.</returns>
        /// <param name="credentials">AWS Credentials.</param>
        /// <param name="appId">Amazon Mobile Analytics Application ID.</param>
        public static MobileAnalyticsManager GetOrCreateInstance(AWSCredentials credential,
                                                                 string appId)
        {
            if (credential == null)
            {
                throw new ArgumentNullException("credential");
            }
            if (string.IsNullOrEmpty(appId))
            {
                throw new ArgumentNullException("appId");
            }

            ClientContextConfig config = new ClientContextConfig(appId);

            return(MobileAnalyticsManager.GetOrCreateInstance(credential, null, config));
        }