Esempio n. 1
0
        /// <summary>
        /// Use this method to set the Flash Messenger service and also
        /// the defaults for the out of the box message types.
        /// </summary>
        /// <param name="settings"></param>
        public static void Initialize(FlashSettings settings = null)
        {
            if (settings == null)
                settings = FlashSettings.Default;

            if (settings.Types.Any(string.IsNullOrWhiteSpace))
                throw new ArgumentException("one or more types are empty, please correct", "settings");

            lock (Sync)
            {
                _instance =  DependencyResolver.Current.GetService<IFlashMessenger>()
                          ?? settings.Messenger;

                Types.Success = settings.Success;
                Types.Error = settings.Error;
                Types.Info = settings.Info;
                Types.Warning = settings.Warning;
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Use this method to set the Flash Messenger service and also
        /// the defaults for the out of the box message types.
        /// </summary>
        /// <param name="settings"></param>
        public static void Initialize(FlashSettings settings = null)
        {
            if (settings == null)
            {
                settings = FlashSettings.Default;
            }

            if (settings.Types.Any(string.IsNullOrWhiteSpace))
            {
                throw new ArgumentException("one or more types are empty, please correct", "settings");
            }

            lock (Sync)
            {
                _instance = DependencyResolver.Current.GetService <IFlashMessenger>()
                            ?? settings.Messenger;

                Types.Success = settings.Success;
                Types.Error   = settings.Error;
                Types.Info    = settings.Info;
                Types.Warning = settings.Warning;
            }
        }