예제 #1
0
 public void OnCancelled(DatabaseError error)
 {
     Raised?.Invoke(this, new FirebaseEventArgs()
     {
         error = error
     });
 }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public Task <T> Raise(T context)
        {
            var taskCompletionSource = new TaskCompletionSource <T>();

            Raised?.Invoke(this, new InteractionRequestedEventArgs(context, () => taskCompletionSource.SetResult(context)));
            return(taskCompletionSource.Task);
        }
예제 #3
0
 public void OnDataChange(DataSnapshot snapshot)
 {
     Raised?.Invoke(this, new FirebaseEventArgs()
     {
         snapshot = snapshot
     });
 }
예제 #4
0
 private void _apiClient_OnLastTimeBar(object sender, TimeBarArgs e)
 {
     if (_isStarted)
     {
         Raised?.Invoke(this, EventArgs.Empty);
     }
 }
예제 #5
0
 public void OnComplete(DatabaseError error, DatabaseReference @ref)
 {
     Raised?.Invoke(this, new FirebaseEventArgs()
     {
         error = error, @ref = @ref
     });
 }
예제 #6
0
 public void OnComplete(Android.Gms.Tasks.Task task)
 {
     Raised?.Invoke(this, new FirebaseEventArgs()
     {
         task = task
     });
 }
예제 #7
0
        public void Raise <T>(T context, Action <T> callback) where T : IInteraction
        {
            HandleInteraction(context);
            callback(context);

            Raised?.Invoke(this, new InteractionRequestEventArgs(context, () => { }));
        }
예제 #8
0
    private void Awake()
    {
        //get a reference to the Raised script
        raised = GetComponent <Raised>();

        //create the axis
        float axisLength = radius * Mathf.Sqrt(3);

        axisOne = new Vector3(0, 0, axisLength);
        axisTwo = new Vector3(axisLength * Mathf.Sqrt(3) / 2, 0, -axisLength / 2);

        grid = new Dictionary <Vector2, Raised.RaiseObject>();

        //create the hex grid
        for (int a1 = -gridSize; a1 <= gridSize; a1++)
        {
            for (int a2 = -gridSize; a2 <= gridSize; a2++)
            {
                //skip tiles that are ouside the hexagon grid
                if (Mathf.Abs(a1) + Mathf.Abs(a2) > gridSize && Mathf.Sign(a1) != Mathf.Sign(a2))
                {
                    continue;
                }

                //create object and add object to the raised list
                GameObject newObject = InstantiateOnHex(a1, a2);
                grid.Add(new Vector2(a1, a2), raised.AddObject(newObject.GetComponent <MeshRenderer>()));
            }
        }
    }
예제 #9
0
 public void OnFailure(Java.Lang.Exception e)
 {
     Raised?.Invoke(this, new FirebaseEventArgs()
     {
         exception = e
     });
 }
예제 #10
0
        public string GetCss()
        {
            var sb = new StringBuilder();

            sb.Append(Raised.StringIf("raised").Spaciate());
            sb.Append(Disabled.StringIf("disabled").Spaciate());
            sb.Append((Emphasis != SegmentEmphasis.Primary).StringIf(Emphasis.ToString().ToLower().Spaciate()));

            return(sb.ToString());
        }
        public async Task <T> RaiseAsync <T>(T context) where T : IInteraction
        {
            var resetEvent = new ManualResetEventSlim();
            var task       = Task.Run(() =>
            {
                resetEvent.Wait();
                return(context);
            });

            Raised?.Invoke(this, new InteractionRequestEventArgs(context, () => resetEvent.Set()));

            return(await task);
        }
예제 #12
0
 public virtual void Raise <TViewModel>(string viewName, ViewModelInfo context, Action <TViewModel> onAvailable)
     where TViewModel : class
 {
     Raised?.Invoke(this, new ViewInteractionRequestEventArgs(
                        viewName, context,
                        view =>
     {
         if (onAvailable != null)
         {
             var viewModel = ViewModelContainerHelper.GetViewModelAs <TViewModel>(view);
             onAvailable.Invoke(viewModel);
         }
     })
                    );
 }
예제 #13
0
        public override void Handle(HandleContext context)
        {
            var packet  = context.Packet;
            var session = context.Session;

            var response = packet as IResponse;

            if (response != null)
            {
                Console.WriteLine("调用回复");

                Invoked?.Invoke(response);
            }

            var e = packet as EventInfo;

            if (e != null)
            {
                Console.WriteLine("事件");

                Raised?.Invoke(e);
            }
        }
예제 #14
0
 protected virtual void OnRaised(WindowRequestEventArgs e)
 {
     Raised?.Invoke(this, e);
 }
예제 #15
0
 public void Raise(string viewName, ViewModelInfo context)
 {
     Raised?.Invoke(this, new ViewInteractionRequestEventArgs(viewName, context, null));
 }
예제 #16
0
 private void BoxedEventRaisedHandler(TBoxed value)
 {
     Raised?.Invoke(value);
 }
예제 #17
0
 protected virtual void OnRaised()
 {
     Raised?.Invoke();
 }
예제 #18
0
 public void Raise()
 {
     Raised?.Invoke();
 }
예제 #19
0
 private void Raise(Event item)
 {
     Raised?.Invoke(item);
 }
예제 #20
0
 public void Raise(Message message, Action <Message> callback)
 {
     Raised?.Invoke(this, new MessageEventArgs(message, callback));
 }
예제 #21
0
파일: SignalEvent.cs 프로젝트: Kagre/Sylvan
 void FireRaisedEvent()
 {
     Raised?.Invoke(this, EventArgs.Empty);
     this.tcs !.SetResult(true);
 }
예제 #22
0
 public static void Raise(T eventData)
 {
     Raised?.Invoke(eventData);
 }
예제 #23
0
 protected virtual void OnRaised(ContextRequestEventArgs e) => Raised?.Invoke(this, e);
예제 #24
0
 /// <summary>Fires the Raised event.</summary>
 /// <param name="context">The context for the interaction request.</param>
 public void Raise(IUserInteraction context)
 {
     Raised?.Invoke(this, new UserInteractionRequestedEventArgs(context));
 }