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

GetInstance() public static method

Gets Mobile Analytics Manager instance by Application ID. Returns Mobile Analytics Manager instance if it's found. Throws InvalidOperationException if the instance has not been instantiated.
public static GetInstance ( string appID ) : MobileAnalyticsManager
appID string Amazon Mobile Analytics Application ID.
return MobileAnalyticsManager
        public static MobileAnalyticsManager GetInstance(string appID)
        {
            if (string.IsNullOrEmpty(appID))
                throw new ArgumentNullException("appID");
            MobileAnalyticsManager managerInstance = null;

            lock (_lock)
            {
                if (_instanceDictionary.TryGetValue(appID, out managerInstance))
                {
                    return managerInstance;
                }
                else
                {
                    throw new InvalidOperationException("Cannot find MobileAnalyticsManager instance for appID " + appID + ". Please call GetOrCreateInstance() first.");
                }
            }
        }