Exemplo n.º 1
0
        /// <summary>
        /// Initializes the <see cref="ShopSettings"/>. This must only be called once and called as early as possible.
        /// </summary>
        /// <param name="settings">The settings instance.</param>
        /// <exception cref="ArgumentNullException"><paramref name="settings" /> is <c>null</c>.</exception>
        /// <exception cref="MethodAccessException">This method must be called once and only once.</exception>
        public static void Initialize(ShopSettings settings)
        {
            if (settings == null)
                throw new ArgumentNullException("settings");
            if (_instance != null)
                throw new MethodAccessException("This method must be called once and only once.");

            _instance = settings;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes the <see cref="ShopSettings"/>. This must only be called once and called as early as possible.
        /// </summary>
        /// <param name="settings">The settings instance.</param>
        /// <exception cref="ArgumentNullException"><paramref name="settings" /> is <c>null</c>.</exception>
        /// <exception cref="MethodAccessException">This method must be called once and only once.</exception>
        public static void Initialize(ShopSettings settings)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }
            if (_instance != null)
            {
                throw new MethodAccessException("This method must be called once and only once.");
            }

            _instance = settings;
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes the <see cref="ShopItemIndexExtensions"/> class.
 /// </summary>
 static ShopItemIndexExtensions()
 {
     _shopSettings = ShopSettings.Instance;
 }
 /// <summary>
 /// Initializes the <see cref="ShopItemIndexExtensions"/> class.
 /// </summary>
 static ShopItemIndexExtensions()
 {
     _shopSettings = ShopSettings.Instance;
 }