/// <summary> /// Sets the Current instance of the EventClient /// </summary> /// <returns></returns> public static AppEventsClient New() { Current = new AppEventsClient(); Current.FromStorage(new JsonStorageProvider()); return(Current); }
/// <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); }
/// <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); }
/// <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); }
public static Rule New(string name) { if (Current == null) { Current = new AppEventsClient(); } var rule = new Rule(name); Current.Rules.Add(rule); return(rule); }