Ejemplo n.º 1
0
        /// <summary>
        /// Initialize the client with dependencies
        /// </summary>
        /// <param name="configStorage">The configuration to use</param>
        /// <param name="deviceInfo">Information about device</param>
        protected void Initialize(IConfigurationStorage configStorage, MobileDeviceInfo deviceInfo=null)
        {
            if (configStorage == null || string.IsNullOrEmpty(configStorage.ApiKey) || !_apiRegex.IsMatch(configStorage.ApiKey))
            {
                Logger.Error("You must provide a valid Bugsnag API key");
                throw new ArgumentException("You must provide a valid Bugsnag API key");
            }
            else
            {
                Config = new Configuration(configStorage, deviceInfo);
                Notifier = new Notifier(Config);

                // Install a default exception handler with this client
                if (Config.AutoNotify)
                    StartAutoNotify();

                Initialized();
            }
        }
Ejemplo n.º 2
0
 public Client(IConfigurationStorage configStorage, MobileDeviceInfo deviceInfo)
 {
     Initialize(configStorage, deviceInfo);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Configuration"/> class. Uses the passed
 /// configuration storage to populate its settings.
 /// </summary>
 /// <param name="storage">The storage to use for settings.</param>
 /// <param name="deviceInfo">Information about device</param>
 public Configuration(IConfigurationStorage storage, MobileDeviceInfo deviceInfo)
 {
     Storage = storage;
     DeviceInfo = deviceInfo;
     Metadata = new Metadata();
     BeforeNotifyCallbacks = new List<Func<Event, bool>>();
     InternalBeforeNotifyCallbacks = new List<Action<Event>>();
 }