示例#1
0
        /// <summary>
        /// Sets the Current instance of the EventClient
        /// </summary>
        /// <returns></returns>
        public static AppEventsClient New()
        {
            Current = new AppEventsClient();

            Current.FromStorage(new JsonStorageProvider());

            return(Current);
        }
示例#2
0
        /// <summary>
        /// Sets the Current instance of the EventClient
        /// </summary>
        /// <returns></returns>
        public static AppEventsClient New <T>() where T : IEventStorageProvider, new()
        {
            Current = new AppEventsClient();

            Current.FromStorage(new T());

            return(Current);
        }
示例#3
0
        /// <summary>
        /// Creates an instance of the AppEventsClient with a rule to add to the listener and setting a storage provider
        /// </summary>
        /// <typeparam name="T">Storage Provider</typeparam>
        /// <param name="newRule">An event Rule to add</param>
        /// <returns></returns>
        public static AppEventsClient New <T>(Rule newRule) where T : IEventStorageProvider, new()
        {
            if (Current == null)
            {
                Current = new AppEventsClient();
                Current.FromStorage(new T());
            }

            Current.Add(newRule);

            return(Current);
        }
示例#4
0
        /// <summary>
        /// Creates an instance of the AppEventsClient with a rule to add to the listener
        /// </summary>
        /// <param name="newRule">An event Rule to add</param>
        /// <returns></returns>
        public static AppEventsClient New(Rule newRule)
        {
            if (Current == null)
            {
                Current = new AppEventsClient();
                Current.FromStorage(new JsonStorageProvider());
            }

            Current.Add(newRule);

            return(Current);
        }
示例#5
0
        public static Rule New(string name)
        {
            if (Current == null)
            {
                Current = new AppEventsClient();
            }

            var rule = new Rule(name);

            Current.Rules.Add(rule);

            return(rule);
        }