コード例 #1
0
        public BugsnagClient(Context context, string apiKey, bool enableMetrics = true)
        {
            if (context == null)
                throw new ArgumentNullException ("context");
            if (apiKey == null)
                throw new ArgumentNullException ("apiKey");

            context = context.ApplicationContext;

            this.apiKey = apiKey;
            sendMetrics = enableMetrics;
            ReleaseStage = GuessReleaseStage (context);
            AutoNotify = true;

            // Install exception handlers
            interceptors = new IDisposable[] {
                new AppDomainInterceptor (this),
                new TaskSchedulerInterceptor (this),
                new AndroidInterceptor (this),
            };

            state = new StateCacher (new StateReporter (this, context));
            activityTracker = new ActivityTracker ();
            exceptionConverter = new ExceptionConverter (this);
            notifier = new Notifier (this, MakeErrorCacheDir (context));
        }
コード例 #2
0
        public BugsnagClient(Context context, string apiKey, bool enableMetrics = true)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            if (apiKey == null)
            {
                throw new ArgumentNullException("apiKey");
            }

            context = context.ApplicationContext;

            this.apiKey  = apiKey;
            sendMetrics  = enableMetrics;
            ReleaseStage = GuessReleaseStage(context);
            AutoNotify   = true;

            // Install exception handlers
            interceptors = new IDisposable[] {
                new AppDomainInterceptor(this),
                new TaskSchedulerInterceptor(this),
                new AndroidInterceptor(this),
            };

            state              = new StateCacher(new StateReporter(this, context));
            activityTracker    = new ActivityTracker();
            exceptionConverter = new ExceptionConverter(this);
            notifier           = new Notifier(this, MakeErrorCacheDir(context));
        }