protected override void Write(LogEventInfo logEvent)
        {
            DefaultMemorytWrite(logEvent);

            if (MethodToCall != null)
            {
                MethodToCall.Invoke(MemoryTarget.Logs);
            }
        }
Exemplo n.º 2
0
        public void Start(MethodToCall methodDelegate)
        {
            _methodDelegate = methodDelegate;

            _consumer           = new EventingBasicConsumer(_channel.Model);
            _consumer.Received += _consumer_Received;
            _channel.Model.BasicConsume(queue: _channel.EndpointName,
                                        autoAck: true,
                                        consumer: _consumer);
        }
        public BodyTriggerAreaComponent(Vector2 size, Body body, MethodToCall callback)
        {
            Data = new List <object>();

            _type         = ComponentType.BodyTriggerArea;
            Area          = BodyFactory.CreateRectangle(Platform.Instance.PhysicsWorld, UnitsConverter.ToSimUnits(size.X), UnitsConverter.ToSimUnits(size.Y), 0.1f);
            Area.BodyType = BodyType.Kinematic;
            Area.IsSensor = true;

            _body    = body;
            Callback = callback;
        }
Exemplo n.º 4
0
        // Method that starts the async call.
        // TODO: Implement a method that makes the async call and returns a WaitHandle.
        internal WaitHandle CallSortAndSearchCallback(MethodToCall method)
        {
            // Create the callback delegate.
            AsyncCallback cb = new AsyncCallback (SortCallbackMethod);

            // Call BeginInvoke().
            IAsyncResult asyncResult = method.BeginInvoke (cb, method);

            // Return the WaitHandle back to the caller of this method.
            return (asyncResult.AsyncWaitHandle);
        }
Exemplo n.º 5
0
        private static IEnumerator Wait(float time, MethodToCall onComplete)
        {
            yield return(new WaitForSeconds(time));

            onComplete?.Invoke();
        }
Exemplo n.º 6
0
 /// <summary>
 /// Calls OnComplete method after [ticks] seconds.
 /// </summary>
 /// <param name="obj">Reference to the monobehaviour (not passed).</param>
 /// <param name="ticks">How long to wait.</param>
 /// <param name="onComplete">Call after timeout.</param>
 public static void WaitAndCall(this MonoBehaviour obj, float ticks, MethodToCall onComplete)
 {
     obj.StartCoroutine(Wait(ticks, onComplete));
 }
Exemplo n.º 7
0
 public static void Query(string title, string[] fields, MethodToCall m)
 {
     // display the dialogue, allowing the user to input data into the fields
     doThisWithTheData = m;
 }
Exemplo n.º 8
0
 public override void Dispose()
 {
     _consumer.Received -= _consumer_Received;
     _methodDelegate     = null;
     base.Dispose();
 }