コード例 #1
0
 public GridViewEventInfo(
     KnownEvents id,
     GridEventType type,
     GridEventDispatchMode dispatchMode)
 {
     this = new GridViewEventInfo(id, type, dispatchMode, false);
 }
コード例 #2
0
        public WeakEventHandler(object sender, IWeakEventListener listener, KnownEvents knownEvent)
        {
            this.eventListener = new WeakReference(listener);
            this.eventSender   = new WeakReference(sender);
            this.knownEvent    = knownEvent;

            this.Update(sender, true);
        }
コード例 #3
0
 public bool IsEventSuspended(KnownEvents eventId)
 {
     if (this.suspendedEvents.ContainsKey(eventId))
     {
         return(this.suspendedEvents[eventId] > 0);
     }
     return(false);
 }
コード例 #4
0
 public static void ResumeEvent(GridViewTemplate template, KnownEvents eventId)
 {
     if (template == null)
     {
         throw new ArgumentNullException("Template");
     }
     template.MasterTemplate?.SynchronizationService.ResumeEvent(eventId);
 }
コード例 #5
0
 public GridViewEventInfo(
     KnownEvents id,
     GridEventType type,
     GridEventDispatchMode dispatchMode,
     bool critical)
 {
     this.id           = id;
     this.type         = type;
     this.dispatchMode = dispatchMode;
     this.critical     = critical;
 }
コード例 #6
0
        public void SuspendEvent(KnownEvents eventId)
        {
            if (!this.suspendedEvents.ContainsKey(eventId))
            {
                this.suspendedEvents.Add(eventId, 0);
            }
            Dictionary <KnownEvents, int> suspendedEvents;
            KnownEvents index;

            (suspendedEvents = this.suspendedEvents)[index = eventId] = suspendedEvents[index] + 1;
        }
コード例 #7
0
        public static bool IsEventSuspended(GridViewTemplate template, KnownEvents eventId)
        {
            if (template == null)
            {
                throw new ArgumentNullException("Template");
            }
            MasterGridViewTemplate masterTemplate = template.MasterTemplate;

            if (masterTemplate != null)
            {
                return(masterTemplate.SynchronizationService.IsEventSuspended(eventId));
            }
            return(false);
        }
コード例 #8
0
ファイル: GridViewRowInfo.cs プロジェクト: RichardHaggard/BDC
        protected virtual void DispatchEvent(
            KnownEvents id,
            GridEventType type,
            GridEventDispatchMode dispatchMode,
            object originator,
            object[] arguments)
        {
            if (this.ViewTemplate == null)
            {
                return;
            }
            GridViewEventInfo eventInfo = new GridViewEventInfo(id, type, dispatchMode);

            GridViewSynchronizationService.DispatchEvent(this.ViewTemplate, new GridViewEvent((object)this, originator, arguments, eventInfo), false);
        }
コード例 #9
0
        public void ResumeEvent(KnownEvents eventId)
        {
            if (!this.suspendedEvents.ContainsKey(eventId))
            {
                return;
            }
            int suspendedEvent = this.suspendedEvents[eventId];

            if (suspendedEvent == 0)
            {
                return;
            }
            int num = suspendedEvent - 1;

            this.suspendedEvents[eventId] = num;
        }
コード例 #10
0
        public static void DispatchEvent(
            GridViewTemplate template,
            GridViewEvent eventData,
            bool postUI)
        {
            if (template == null)
            {
                throw new ArgumentNullException("Template");
            }
            MasterGridViewTemplate masterTemplate = template.MasterTemplate;

            if (masterTemplate == null)
            {
                return;
            }
            GridViewSynchronizationService synchronizationService = masterTemplate.SynchronizationService;

            if (synchronizationService == null)
            {
                return;
            }
            if (eventData.Info.Type == GridEventType.Both && postUI)
            {
                KnownEvents       id         = eventData.Info.Id;
                bool              critical   = eventData.Info.Critical;
                object[]          arguments  = eventData.Arguments;
                object            sender     = eventData.Sender;
                object            originator = eventData.Originator;
                GridViewEventInfo eventInfo1 = new GridViewEventInfo(id, GridEventType.Data, GridEventDispatchMode.Send, critical);
                GridViewEvent     gridEvent1 = new GridViewEvent(sender, originator, arguments, eventInfo1);
                GridViewEventInfo eventInfo2 = new GridViewEventInfo(id, GridEventType.UI, GridEventDispatchMode.Post, critical);
                GridViewEvent     gridEvent2 = new GridViewEvent(sender, originator, arguments, eventInfo2);
                synchronizationService.DispatchEvent(gridEvent1);
                synchronizationService.DispatchEvent(gridEvent2);
            }
            else
            {
                synchronizationService.DispatchEvent(eventData);
            }
        }
コード例 #11
0
 public WeakEventHandlerList(IWeakEventListener listener, KnownEvents knownEvent)
 {
     this.eventListener = new WeakReference <IWeakEventListener>(listener);
     this.knownEvent    = knownEvent;
 }