Amazon.MobileAnalytics.MobileAnalyticsManager.MobileAnalyticsManager.GetOrCreateInstanceHelper C# (CSharp) 메소드

GetOrCreateInstanceHelper() 개인적인 정적인 메소드

private static GetOrCreateInstanceHelper ( string appID, AWSCredentials credentials, RegionEndpoint regionEndpoint, MobileAnalyticsManagerConfig maConfig ) : MobileAnalyticsManager
appID string
credentials Amazon.Runtime.AWSCredentials
regionEndpoint RegionEndpoint
maConfig MobileAnalyticsManagerConfig
리턴 MobileAnalyticsManager
        private static MobileAnalyticsManager GetOrCreateInstanceHelper(string appID, AWSCredentials credentials, RegionEndpoint regionEndpoint, MobileAnalyticsManagerConfig maConfig)
        {
#if BCL
            ValidateParameters();
#endif
            MobileAnalyticsManager managerInstance = null;
            bool isNewInstance = false;

            lock (_lock)
            {
                if (_instanceDictionary.TryGetValue(appID, out managerInstance))
                {
                    return managerInstance;
                }
                else
                {
                    managerInstance = new MobileAnalyticsManager(appID, credentials, regionEndpoint, maConfig);
                    _instanceDictionary[appID] = managerInstance;
                    isNewInstance = true;
                }
            }

            if (isNewInstance)
            {
                managerInstance.Session.Start();
            }

            _backgroundRunner.StartWork();

            return managerInstance;
        }

Usage Example

        public static MobileAnalyticsManager GetOrCreateInstance(AWSCredentials credential,
                                                                 string appId)
        {
            if (credential == null)
            {
                throw new ArgumentNullException("credential");
            }
            if (string.IsNullOrEmpty(appId))
            {
                throw new ArgumentNullException("appId");
            }

            return(MobileAnalyticsManager.GetOrCreateInstanceHelper(appId, credential, null));
        }