Пример #1
0
        private void RemoteEventCounts(object sender, FbRemoteEventEventArgs args)
        {
            if (args.Counts == 1)
            {
                switch (args.Name)
                {
                    case "NEW_CUSTOMER":
                        LoadData("customer", lstCustomer);
                        break;

                    case "NEW_SUPPLIER":
                        LoadData("supplier", lstSupplier);
                        break;
                }
            }
        }
Пример #2
0
        private void OnRemoteEventCounts()
        {
            bool canceled = false;

            int[] actualCounts = (int[])_revent.ActualCounts.Clone();
            if (_revent.PreviousCounts != null)
            {
                for (int i = 0; i < _revent.ActualCounts.Length; i++)
                {
                    actualCounts[i] -= _revent.PreviousCounts[i];
                }
            }

            // Send individual event notifications
            for (int i = 0; i < actualCounts.Length; i++)
            {
                FbRemoteEventEventArgs args = new FbRemoteEventEventArgs(_revent.Events[i], actualCounts[i]);
                if (RemoteEventCounts != null)
                {
                    _synchronizationContext.Send(_ =>
                    {
                        RemoteEventCounts(this, args);
                    }, null);
                }

                if (args.Cancel)
                {
                    canceled = true;
                    break;
                }
            }

            if (canceled)
            {
                // Requeque
                CancelEvents();
            }
            else
            {
                // Requeque
                QueueEvents();
            }
        }
Пример #3
0
        private void OnRemoteEventCounts()
        {
            bool canceled = false;

            if (this.RemoteEventCounts != null)
            {
                int[] actualCounts = (int[])this.revent.ActualCounts.Clone();
                if (this.revent.PreviousCounts != null)
                {
                    for (int i = 0; i < this.revent.ActualCounts.Length; i++)
                    {
                        actualCounts[i] -= this.revent.PreviousCounts[i];
                    }
                }

                // Send individual event notifications
                for (int i = 0; i < actualCounts.Length; i++)
                {
                    FbRemoteEventEventArgs args = new FbRemoteEventEventArgs(this.revent.Events[i], actualCounts[i]);
                    this.RemoteEventCounts(this, args);

                    if (args.Cancel)
                    {
                        canceled = true;
                        break;
                    }
                }

                if (canceled)
                {
                    // Requeque
                    this.CancelEvents();
                }
                else
                {
                    // Requeque
                    this.QueueEvents();
                }
            }
        }
Пример #4
0
        private void OnRemoteEventCounts()
        {
            bool canceled = false;

            if (this.RemoteEventCounts != null)
            {
                int[] actualCounts = (int[])this.revent.ActualCounts.Clone();
                if (this.revent.PreviousCounts != null)
                {
                    for (int i = 0; i < this.revent.ActualCounts.Length; i++)
                    {
                        actualCounts[i] -= this.revent.PreviousCounts[i];
                    }
                }

                // Send individual event notifications
                for (int i = 0; i < actualCounts.Length; i++)
                {
                    FbRemoteEventEventArgs args = new FbRemoteEventEventArgs(this.revent.Events[i], actualCounts[i]);
                    this.RemoteEventCounts(this, args);

                    if (args.Cancel)
                    {
                        canceled = true;
                        break;
                    }
                }

                if (canceled)
                {
                    // Requeque
                    this.CancelEvents();
                }
                else
                {
                    // Requeque
                    this.QueueEvents();
                }
            }
        }
		private void OnRemoteEventCounts()
		{
			bool canceled = false;

			int[] actualCounts = (int[])_revent.ActualCounts.Clone();
			if (_revent.PreviousCounts != null)
			{
				for (int i = 0; i < _revent.ActualCounts.Length; i++)
				{
					actualCounts[i] -= _revent.PreviousCounts[i];
				}
			}

			// Send individual event notifications
			for (int i = 0; i < actualCounts.Length; i++)
			{
				FbRemoteEventEventArgs args = new FbRemoteEventEventArgs(_revent.Events[i], actualCounts[i]);
				if (RemoteEventCounts != null)
				{
					_synchronizationContext.Send(_ =>
					{
						RemoteEventCounts(this, args);
					}, null);
				}

				if (args.Cancel)
				{
					canceled = true;
					break;
				}
			}

			if (canceled)
			{
				// Requeque
				CancelEvents();
			}
			else
			{
				// Requeque
				QueueEvents();
			}
		}