예제 #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="msg"></param>
 /// <param name="callback"></param>
 public BooleanSet(string msg, EventCallback <RealmEventArgs> callback)
 {
     _callback = callback;
     _set      = new Dictionary <string, bool>();
     _table    = new EventTable {
         { "message", msg }
     };
 }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the class with the given type and event table
        /// </summary>
        public RealmEventArgs(string type, EventTable table)
        {
            Validation.IsNotNullOrEmpty(type, "type");
            Validation.IsNotNull(table, "table");

            Type = type;
            Data = table;
        }
예제 #3
0
        /// <summary>
        /// Instantiates and throws an event of the given type
        /// </summary>
        public void ThrowEvent <T>(object sender, EventTable table) where T : EventBase
        {
            Log.DebugFormat("Create instance of Event to throw with Type {0}", typeof(T));

            EventBase evt;

            try
            {
                evt = Activator.CreateInstance <T>();
                if (evt.IsNull())
                {
                    throw new InstanceNotFoundException(string.Format(Resources.ERR_EVENT_INSTANTIATE_FAILURE, typeof(T)));
                }
            }
            catch
            {
                throw new InstanceNotFoundException(string.Format(Resources.ERR_EVENT_INSTANTIATE_FAILURE, typeof(T)));
            }

            evt.Args = new RealmEventArgs(table);
            ThrowEvent(sender, evt);
        }
예제 #4
0
        /// <summary>
        /// Initializes a new instance of the class with the given event table
        /// </summary>
        public RealmEventArgs(EventTable table)
        {
            Validation.IsNotNull(table, "table");

            Data = table;
        }
예제 #5
0
 /// <summary>
 /// Initializes a new instance of the class
 /// </summary>
 public RealmEventArgs()
 {
     Data = new EventTable();
 }
예제 #6
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="table"></param>
 /// <param name="callback"></param>
 public BooleanSet(EventTable table, EventCallback <RealmEventArgs> callback)
 {
     _callback = callback;
     _set      = new Dictionary <string, bool>();
     _table    = table;
 }
예제 #7
0
 /// <summary>
 /// Overload function for throwing an event
 /// </summary>
 public void ThrowEvent(object sender, IEventBase thrownEvent, EventTable table)
 {
     thrownEvent.Args = new RealmEventArgs(table);
     ThrowEvent(sender, thrownEvent);
 }