Exemple #1
0
        //helpers
        private static void Set(this ISignalREvent @event, ISignalREventHandler handler, string key, object value)
        {
            if (@event == null)
            {
                throw new ArgumentNullException(nameof(@event));
            }

            if (handler == null)
            {
                throw new ArgumentNullException(nameof(handler));
            }
            var theKey = string.Format("{0}_{1}", key, handler.GetType().FullName);

            @event.Bags[theKey] = value;
        }
Exemple #2
0
        private static object Get(this ISignalREvent @event, ISignalREventHandler handler, string key, object defaultValue)
        {
            if (@event == null)
            {
                throw new ArgumentNullException(nameof(@event));
            }

            if (handler == null)
            {
                throw new ArgumentNullException(nameof(handler));
            }

            var theKey = string.Format("{0}_{1}", key, handler.GetType().FullName);

            if ([email protected](theKey))
            {
                return(defaultValue);
            }
            return(@event.Bags[theKey]);
        }