Exemplo n.º 1
0
 private void CaseLockedPage_AskForLockManualMA(object sender, CustomEventArgs.AccessionOrderReturnEventArgs e)
 {
     UI.AppMessaging.MessagingPath.Instance.StartSendRequest(e.AccessionOrder, this.m_CuttingWorkspaceWindow.PageNavigator);
     //AppMessaging.MessagingPath.Instance.LockWasReleased += MessageQueuePath_LockWasReleasedManualMA;
     //AppMessaging.MessagingPath.Instance.HoldYourHorses += Instance_HoldYourHorses;
     UI.AppMessaging.MessagingPath.Instance.Nevermind += MessageQueuePath_Nevermind;
 }
Exemplo n.º 2
0
        private void poll_Tick(object o)
        {
            lock (pollLock)
            {
                HashSet<Action<DirectInputData>> action;
                BufferedDataCollection queue = null;

                try
                {
                    _device.Poll();
                    queue = _device.GetBufferedData();
                }
                catch
                {
                    Debug.Print("DirectInputKeyboard::poll_tick exception");
                    _pollTimer.Change(Timeout.Infinite, Timeout.Infinite);
                    if (OnError != null)
                        OnError(this, EventArgs.Empty);

                    return;
                }

                if (queue != null)
                {
                    foreach (BufferedData data in queue)
                    {
                        Key dataType = (Key)data.Offset;
                        KeyState state = (KeyState)data.Data;

                        DirectInputData keyData = new DirectInputData()
                        {
                            Value = data.Data,
                            KeyboardKey = dataType,
                            Type = DIDataType.Keyboard,
                            DeviceName = Name

                        };
                        CustomEventArgs<DirectInputData> eventArg = new CustomEventArgs<DirectInputData>(keyData);

                        _actionMap.TryGetValue(dataType, out action);

                        if (action != null)
                            action.ToList().ForEach(a => a(keyData));

                        if (state == KeyState.Down && OnKeyDown != null)
                            OnKeyDown(this, eventArg);

                        if (state == KeyState.Up)
                        {
                            if (OnKeyUp != null)
                                OnKeyUp(this, eventArg);
                            if (OnKeyPress != null)
                                OnKeyPress(this, eventArg);
                        }

                    }
                }
            }
              
        }
 private void Player_PlaybackBitrateChanged(object sender, CustomEventArgs<long> e)
 {
     if (e.Value > 0)
     {
         LastBitrate = e.Value;
     }
 }
Exemplo n.º 4
0
 protected void PageManager1_CustomEvent(object sender, CustomEventArgs e)
 {
     if (e.EventArgument == "SAVE")
     {
         SaveAndClose();
     }
 }
Exemplo n.º 5
0
        private void OnRaiseCustomEvent(CustomEventArgs args)
        {
            EventHandler<CustomEventArgs> handler = RaiseCustomEvent;
            if (handler != null)
            {
                handler(this, args);

            }
        }
Exemplo n.º 6
0
        public void RaiseEvent()
        {
            // Write some code that does something useful here
            // then raise the event. You can also raise an event
            // before you execute a block of code.

            CustomEventArgs args = new CustomEventArgs();
            args.TimeReached = DateTime.Now;
            OnRaiseCustomEvent(args);
        }
 public override void Pulse()
 {
     if (DateTime.Now > nextUIupdate)
     {
         nextUIupdate = DateTime.Now.AddMilliseconds(updateinterval);
         CustomEventArgs args = new CustomEventArgs();
         if (UpdateUI != null)
             UpdateUI(args);
     }
 }
Exemplo n.º 8
0
 public void CheckRequestTimeoutMessageInError()
 {
     CustomEventArgs<string> cea = new CustomEventArgs<string> ();
     cea.CurrRequestType = CurrentRequestType.Subscribe;
     cea.IsError = true;
     cea.IsTimeout = false;
     cea.Message = "The request timed out.";
     cea.PubnubRequestState = null;
     Assert.IsTrue(Utility.CheckRequestTimeoutMessageInError<string> (cea));
 }
Exemplo n.º 9
0
 protected void PageManager1_CustomEvent(object sender, CustomEventArgs e)
 {
     if (e.EventArgument == "Confirm_OK")
     {
         Alert.Show("执行了确定操作!");
     }
     else if (e.EventArgument == "Confirm_Cancel")
     {
         Alert.Show("执行了取消操作!");
     }
 }
Exemplo n.º 10
0
        public void ShouldFireEventHandlerViaFireWithOneArgumentWithCorrentData()
        {
            var eventArgs = new CustomEventArgs();
            _customEventHandler.Fire(eventArgs);

            Thread.Sleep(50);

            Assert.NotNull(_customEventHandlerData);
            Assert.Null(_customEventHandlerData.Sender);
            Assert.AreEqual(eventArgs, _customEventHandlerData.EventArgs);
        }
Exemplo n.º 11
0
 /// <summary>
 /// 새로운 대화메시지 수신시 대화창 생성
 /// </summary>
 /// <param name="ar">d|formkey|id/id/...|name|메시지내용</param>
 private void OpenNewChatFormOnMsgReceived(object sender, CustomEventArgs e)    //ar = d|formkey|id/id/...|name|메시지내용
 {
     try
     {
         ChatObj chatObj = (ChatObj)e.GetItem;
         ChatForm chatForm = new ChatForm(connection, miscCtrl, chatObj);
     }
     catch (Exception exception)
     {
         Logger.error(exception.ToString());
     }
 }
Exemplo n.º 12
0
    protected virtual void OnRaiseCustomEvent(CustomEventArgs e)
    {
        // Make a temporary copy of the event
        EventHandler<CustomEventArgs> handler = RaiseCustomEvent;

        // Event will be null if there are no subscribers
        if (handler != null)
        {
            // Use the () operator to raise the event.
            handler(this, e);
        }
    }
        public DataContractEventArgsSerializerTest()
        {
            this.eventArgsToSerialize = new CustomEventArgs(true);

            using (MemoryStream ms = new MemoryStream())
            {
                var serializer = new DataContractSerializer(typeof(CustomEventArgs));
                serializer.WriteObject(ms, this.eventArgsToSerialize);
                this.inputAndOutput = Convert.ToBase64String(ms.ToArray());
            }

            this.testee = new DataContractEventArgsSerializer();
        }
        public BinaryEventArgsSerializerTest()
        {
            this.eventArgsToSerialize = new CustomEventArgs(true);

            using (MemoryStream ms = new MemoryStream())
            {
                var formatter = new BinaryFormatter();
                formatter.Serialize(ms, this.eventArgsToSerialize);
                this.inputAndOutput = Convert.ToBase64String(ms.ToArray());
            }

            this.testee = new BinaryEventArgsSerializer();
        }
 protected virtual void OnRaiseEvent(CustomEventArgs e)
 {
     EventHandler<CustomEventArgs> handler = RaiseCustomEvent;
     if (handler != null)
     {
         e.Message += String.Format("{0:hh:mm:ss}", DateTime.Now);
         handler(this, e);
     }
     else
     {
         Console.WriteLine("There are no listeners.");
     }
 }
Exemplo n.º 16
0
        protected virtual void OnRaiseCustomEvent(int countLeft)
        {
            EventHandler handler = RaiseCustomEvent;

            // Event will be null if there are no subscribers
            if (handler != null)
            {
                // Format the string to send inside the CustomEventArgs parameter
                CustomEventArgs e = new CustomEventArgs(countLeft);

                // Use the () operator to raise the event.
                handler(this, e);
            }
        }
Exemplo n.º 17
0
 private void CreateMemoFormOnMemoMsgReceived(object sender, CustomEventArgs e)
 {
     try
     {
         MemoObj memoObj = (MemoObj)e.GetItem;
         MemoForm memoForm = new MemoForm(connection, memoObj);
         memoForm.Show();
         memoForm.Activate();
     }
     catch (Exception ex)
     {
         Logger.error(ex.ToString());
     }
 }
Exemplo n.º 18
0
        private void CancelTestWarningPage_CancelTest(object sender, CustomEventArgs.CancelTestEventArgs e)
        {
            YellowstonePathology.Business.Gateway.AccessionOrderGateway.SetPanelSetOrderAsCancelledTest(e.PanelSetOrder.ReportNo);
            YellowstonePathology.Business.Gateway.AccessionOrderGateway.InsertTestCancelledTestOrder(e.PanelSetOrder.ReportNo, e.PanelSetOrder.PanelSetId, e.PanelSetOrder.PanelSetName);

            YellowstonePathology.Business.Test.AccessionOrder accessionOrder = YellowstonePathology.Business.Persistence.DocumentGateway.Instance.PullAccessionOrder(e.AccessionOrder.MasterAccessionNo, this.m_Window);
            YellowstonePathology.Business.Test.TestCancelled.TestCancelledTestOrder testCancelledTestOrder = (YellowstonePathology.Business.Test.TestCancelled.TestCancelledTestOrder)accessionOrder.PanelSetOrderCollection.GetPanelSetOrder(e.PanelSetOrder.ReportNo);

            testCancelledTestOrder.Distribute = false;
            testCancelledTestOrder.NoCharge = true;
            testCancelledTestOrder.Comment = e.ReasonForCancelation;

            this.ShowTestCancelledResultPage(testCancelledTestOrder, accessionOrder);
        }
 private void Player_PlayStateChanged(object sender, CustomEventArgs<MediaPluginState> e)
 {
     if (isStartupHeuristicsActive && e.Value == MediaPluginState.Playing)
     {
         isStartupHeuristicsActive = false;
         if (ActiveAdaptiveMediaPlugin != null)
         {
             var videoStream = ActiveAdaptiveMediaPlugin.CurrentSegment.SelectedStreams.Where(i => i.Type == StreamType.Video).FirstOrDefault();
             if (videoStream != null)
             {
                 videoStream.SetSelectedTracks(videoStream.AvailableTracks);
             }
         }
     }
 }
Exemplo n.º 20
0
        /// <summary>
        /// 로그인 시 부재중 건수 정보 보이기
        /// 메시지 형식
        /// </summary>
        /// <param name="arg"></param>
        private void PopUpOnUnCheckedDataReceived(object sender, CustomEventArgs e)
        {
            int[] arg = (int[])e.GetItem;

            if (arg[0] >= 0)
                NRmemo.Text = Convert.ToString(arg[0]);
            if (arg[1] >= 0)
                NRfile.Text = Convert.ToString(arg[1]);
            if (arg[2] >= 0)
            {
                NRnotice.Text = Convert.ToString(arg[2]);
                if (arg[2] > 0)
                    connection.SendMsgReqUnReadNotice();
            }
            if (arg[3] >= 0)
                NRtrans.Text = Convert.ToString(arg[3]);
        }
Exemplo n.º 21
0
        private void CancelTestWarningPage_CancelTest(object sender, CustomEventArgs.CancelTestEventArgs e)
        {
            YellowstonePathology.Business.Interface.IOrderTarget orderTarget = e.AccessionOrder.SpecimenOrderCollection.GetOrderTarget(e.PanelSetOrder.OrderedOnId);
            Business.Test.TestCancelled.TestCancelledTest cancelledTest = new Business.Test.TestCancelled.TestCancelledTest();
            YellowstonePathology.Business.Test.TestOrderInfo testOrderInfo = new Business.Test.TestOrderInfo(cancelledTest, orderTarget, true);
            YellowstonePathology.Business.Visitor.OrderTestOrderVisitor orderTestOrderVisitor = new Business.Visitor.OrderTestOrderVisitor(testOrderInfo);

            e.AccessionOrder.PanelSetOrderCollection.Remove(e.PanelSetOrder);

            e.AccessionOrder.TakeATrip(orderTestOrderVisitor);
            Business.Test.TestCancelled.TestCancelledTestOrder testCancelledTestOrder = (Business.Test.TestCancelled.TestCancelledTestOrder)orderTestOrderVisitor.PanelSetOrder;
            testCancelledTestOrder.CancelledTestId = e.PanelSetOrder.PanelSetId;
            testCancelledTestOrder.CancelledTestName = e.PanelSetOrder.PanelSetName;
            testCancelledTestOrder.Distribute = false;
            testCancelledTestOrder.NoCharge = true;
            testCancelledTestOrder.Comment = e.ReasonForCancelation;

            this.ShowTestCancelledResultPage(testCancelledTestOrder, e.AccessionOrder);
        }
Exemplo n.º 22
0
 private void MemoReplyDone(object sender, CustomEventArgs e)
 {
     try
     {
         MemoObj replyObj = (MemoObj)e.GetItem;
         if (Members.ContainLoginUserNode(replyObj.SenderId))
         {
             connection.SendMsgDeliverMemo(replyObj);
         }
         else
         {
             connection.SendMsgSaveMemoOnAway(replyObj);
         }
         //string msg = "19|" + this.myname + "|" + this.myid + "|" + memoContent.Trim();
         //string smsg = "4|" + this.myname + "|" + this.myid + "|" + memoContent.Trim();
     }
     catch (Exception exception)
     {
         Logger.error(exception.ToString());
     }
 }
Exemplo n.º 23
0
        public void HandleEvent(object sender, EventArgs args)
        {
            CustomEventArgs eventArgs = (CustomEventArgs)args;
            int             indicator = eventArgs.getIndicator();

            switch (indicator)
            {
            case (int)ShimmerBluetooth.ShimmerIdentifier.MSG_IDENTIFIER_STATE_CHANGE:

                System.Diagnostics.Debug.Write(((ShimmerBluetooth)sender).GetDeviceName() + " State = " + ((ShimmerBluetooth)sender).GetStateString() + System.Environment.NewLine);
                int state = (int)eventArgs.getObject();
                if (state == (int)ShimmerBluetooth.SHIMMER_STATE_CONNECTED)
                {
                }
                break;

            case (int)ShimmerBluetooth.ShimmerIdentifier.MSG_IDENTIFIER_DATA_PACKET:
                // this is essential to ensure the object is not a reference
                ObjectCluster objectCluster = new ObjectCluster((ObjectCluster)eventArgs.getObject());
                ojc = objectCluster;
                ojcArray.Add(objectCluster);
                break;
            }
        }
Exemplo n.º 24
0
 private void AccessionOrderPage_Next(object sender, CustomEventArgs.ReportNoReturnEventArgs e)
 {
     YellowstonePathology.Business.Test.PanelSetOrder panelSetOrder = this.m_AccessionOrder.PanelSetOrderCollection.GetPanelSetOrder(e.ReportNo);
     if (panelSetOrder.PanelSetId == 3 ||
         panelSetOrder.PanelSetId == 14 ||
         panelSetOrder.PanelSetId == 15 ||
         panelSetOrder.PanelSetId == 61 ||
         panelSetOrder.PanelSetId == 62 ||
         panelSetOrder.PanelSetId == 116)
     {
         YellowstonePathology.UI.Login.FinalizeAccession.FinalizeCytologyPath finalizeCytologyPath = new YellowstonePathology.UI.Login.FinalizeAccession.FinalizeCytologyPath(
             this.m_ClientOrder, this.m_AccessionOrder,
             e.ReportNo, this.m_PageNavigator);
         finalizeCytologyPath.Return += new YellowstonePathology.UI.Login.FinalizeAccession.FinalizeCytologyPath.ReturnEventHandler(CytologyFinalizationPath_Return);
         finalizeCytologyPath.Finish += new YellowstonePathology.UI.Login.FinalizeAccession.FinalizeCytologyPath.FinishEventHandler(CytologyFinalizationPath_Finish);
         finalizeCytologyPath.Start();
     }
     else
     {
         FinalizeAccession.FinalizeAccessionPath finalizeAccessionPath = new FinalizeAccession.FinalizeAccessionPath(e.ReportNo, this.m_PageNavigator, this.m_AccessionOrder);
         finalizeAccessionPath.Return += new FinalizeAccession.FinalizeAccessionPath.ReturnEventHandler(FinalizeAccessionPath_Return);
         finalizeAccessionPath.Start();
     }
 }
Exemplo n.º 25
0
 /// <summary>
 /// 공지함 리스트 생성
 /// </summary>
 /// <param name="msg"></param>
 private void DisplayFormOnNoticeListReceived(object sender, CustomEventArgs e)
 {//L|time‡content‡mode‡sender‡seqnum‡title|...
     try
     {
         string[] msg = (string[])e.GetItem;
         if (msg.Length >= 2)
         {
             if (noticelistform != null || noticelistform.IsDisposed)
             {
                 noticelistform = new NoticeListForm(connection);
             }
             noticelistform.AssignListInfo(msg);
             noticelistform.Show();
         }
         else
         {
             MessageBox.Show("등록된 공지가 없습니다.", "공지없음", MessageBoxButtons.OK);
         }
     }
     catch (Exception ex)
     {
         Logger.error("MakeNoticeListForm() " + ex.StackTrace.ToString());
     }
 }
Exemplo n.º 26
0
    public void OnEvent(CustomEventArgs messageData)
    {
        var message = messageData.Message;

        switch (message)
        {
        case GameEventName.GoUseAutoReward:
            var tokensReward = messageData.Value as List <TokenRewardEnum>;
            ProcessAutoUseTokens(tokensReward);
            break;

        case GameEventName.GoSelectTokenReward:
            _currentToken = messageData.Value as IToken;
            Debug.Log(_currentToken.GetDataToken().Token);
            FindEmptyCell();
            break;

        case GameEventName.GoAddTokenReward:
            _currentPlayer = (GameClass)messageData.Value;
            var token = _currentToken.GetDataToken().Token;
            var index = _dictionaryToken[_currentPlayer].IndexOf(TokenRewardEnum.Undefined);
            _dictionaryToken[_currentPlayer][index] = token;
            var art = _dictionaryIconToken[_currentPlayer][index].GetComponent <SpriteRenderer>();
            art.sprite = _currentToken.GetDataToken().Art;
            _publisher.Publish(null, new CustomEventArgs(GameEventName.GoEndSelectTokenReward, _currentToken));
            _currentToken = null;
            break;

        case GameEventName.GoRemoveTokenReward:
            break;

        case GameEventName.GoDeActivateTargetsPlayer:
            _currentToken = null;
            break;
        }
    }
Exemplo n.º 27
0
        private void ParseOnLoaderMode(string hexString)
        {
            var e = new CustomEventArgs(0, hexString, null, 0, true, null, CallMode.LoaderMode, _serialPort);

            OnParsed(e);
        }
Exemplo n.º 28
0
        void _fvm_ChangeState(object sender, EventArgs e)
        {
            string state = (string)sender;

            switch (state)
            {
            case "UserInfoRetrieved":
                flickrLoggedInUser.DataContext = _fvm.FlickrPerson;
                if (_fvm.FlickrPerson != null &&
                    !string.IsNullOrEmpty(_fvm.FlickrPerson.BuddyIconUrl) &&
                    _fvm.FlickrPerson.BuddyIconUrl != _fvm.BuddyIconUrl)
                {
                    Services.AppDatabase.Current.AddAppState("fp.BuddyIconUrl", _fvm.FlickrPerson.BuddyIconUrl);
                }
                flickrLoggedInUser.Visibility = Visibility.Visible;
                break;

            case "UserPublicPhotosRetrieved":
                flickrListOfPics.LoadPictures(_fvm.FlickrPersonPhotos, "Your Favourites");
                flickrListOfPics.Visibility = Visibility.Visible;
                CustomPagingEventArgs ea1 = e as CustomPagingEventArgs;
                //if (e is CustomPagingEventArgs) _page_User = ea1.PageNo + 1;
                break;

            case "PhotoInfoRetrieved":
                flickrPictureDetails.LoadPicture(_fvm.SelectedPhotoInfo);
                break;

            case "PhotoStreamPhotosRetrieved":
                flickrPictureDetails.LoadPhotoStream(_fvm.FlickrPhotoStreamPhotos);
                break;

            case "PhotoExifRetrieved":
                flickrPictureExif.LoadInfo(_fvm.SelectedPhoto, _fvm.SelectedExifInfo);
                break;

            case "PhotoFavourited":
                CustomEventArgs arg1 = (CustomEventArgs)e;
                SendInformationNotification("Favourite Added", 3, arg1.Photo.ThumbnailUrl);
                _fvm.GetLoggedInFavourites(_fvm.FlickrPerson.UserId, _page_User);
                break;

            case "PhotoUnfavourited":
                CustomEventArgs arg3 = (CustomEventArgs)e;
                SendInformationNotification("Favourite Removed", 3, arg3.Photo.ThumbnailUrl);
                _fvm.GetLoggedInFavourites(_fvm.FlickrPerson.UserId, _page_User);
                break;

            case "PhotoPromoted":
                CustomEventArgs arg2 = (CustomEventArgs)e;
                SendInformationNotification("Photo Promoted", 3, arg2.Photo.ThumbnailUrl);
                break;

            case "PhotoCommentsRetrieved":
                flickrPictureDetails.LoadComments(_fvm.SelectedPhotoComments);
                break;

            case "AuthorPublicPhotosRetrieved":

                flickrListOfPics.LoadPictures(_fvm.FlickrPersonPhotos, _fvm.SelectedPhoto.OwnerName + " Favourites");
                flickrListOfPics.Visibility = Visibility.Visible;
                ShowPicturesList();
                CustomPagingEventArgs ea2 = e as CustomPagingEventArgs;
                //if (e is CustomPagingEventArgs) _page_User = ea2.PageNo + 1;
                break;

            case "LogoutComplete":

                NavigationService.NavigateOnUI("FlickrLoginView");

                break;
            }
        }
 private void AliquotAndStainOrderPage_ShowTaskOrderPage(object sender, CustomEventArgs.AcknowledgeStainOrderEventArgs e)
 {
     this.ShowTaskOrderPage(e.TaskOrderStainAcknowledgement);
 }
 private void ItemsReceivedPage_ShowClientOrderDetailsPage(object sender, CustomEventArgs.ClientOrderDetailReturnEventArgs e)
 {
     this.m_ClientOrderReceivingHandler.ResetTheSelectedClientOrderDetailToThisOne(e.ClientOrderDetail);
     this.ShowClientOrderDetailsPage();
 }
 public void HandleCustomEvent(object sender, CustomEventArgs e)
 {
 }
Exemplo n.º 32
0
 private static void CustomEventHandler(object sender, CustomEventArgs e)
 {
     Console.WriteLine($"Custom event received. Data1: { e.Data1 } Data2: { e.Data2 }.");
 }
Exemplo n.º 33
0
 protected virtual void OnServerEventWithCustomArgs(CustomEventArgs args) => this.ServerEventWithCustomArgs?.Invoke(this, args);
Exemplo n.º 34
0
        protected override void ListensenUDP()
        {
            var remoteIpEndPoint = new IPEndPoint(IPAddress.Any, 0);

            flag = true;
            var    buffer            = new byte[4096 * 2];
            string error             = string.Empty;
            var    numberOfBytesRead = 0;
            var    mode = CallMode.DataMode;

            while (flag)
            {
                try
                {
                    Array.Clear(buffer, 0, 4096 * 2);
                    var receiveBytes = _udpClient.Receive(ref remoteIpEndPoint);
                    if (BitConverter.ToUInt16(receiveBytes, 0) != 0xEE01)
                    {
                        continue;
                    }
                    if (receiveBytes.Length < 4)
                    {
                        continue;
                    }
                    var PacketLength = BitConverter.ToUInt16(receiveBytes, 2);

                    Array.Copy(receiveBytes, 4, buffer, numberOfBytesRead, receiveBytes.Length - 4);
                    numberOfBytesRead = receiveBytes.Length - 4;
                    // Incoming message may be larger than the buffer size.
                    while (numberOfBytesRead < PacketLength)
                    {
                        receiveBytes = _udpClient.Receive(ref remoteIpEndPoint);
                        Array.Copy(receiveBytes, 0, buffer, numberOfBytesRead, receiveBytes.Length);
                        numberOfBytesRead += receiveBytes.Length;
                    }
                }
                catch (SocketException exception)
                {
                    if (exception.ErrorCode != 0x2714) //程序关闭
                    {
                        error = exception.Message;
                        mode  = CallMode.ErrMode;
                        flag  = false;
                    }
                    else
                    {
                        flag = false;
                        return;
                    }
                }
                finally
                {
                    if (numberOfBytesRead > 4)
                    {
                        var e = new CustomEventArgs(0, string.Empty, buffer, numberOfBytesRead, flag, error, mode,
                                                    _udpClient);
                        numberOfBytesRead = 0;
                        OnParsed(e);
                    }
                }
            }
        }
Exemplo n.º 35
0
 protected virtual void EventLogic(CustomEventArgs e)
 {
 }
Exemplo n.º 36
0
 private void OnPushTokenUpdated(object sender, CustomEventArgs <Uri> e)
 {
     DispatchCommandResult(new PluginResult(PluginResult.Status.OK, e.Result.ToString()));
 }
Exemplo n.º 37
0
 private void GameController_RectangleEnclosed(object sender,
                                               CustomEventArgs <List <RectangleStructure> > e)
 {
     DrawRectangles(e.Content);
 }
Exemplo n.º 38
0
 private void GameController_PlayerNameSet(object sender, CustomEventArgs <ReadOnlyCollection <string> > e)
 {
     DisplayPlayersName(e.Content);
 }
 private void ThePlayer_OnMediaFailed(object sender, CustomEventArgs <Exception> e)
 {
     Log.ErrorException("Error playing video: " + e.Value.Message, e.Value);
 }
Exemplo n.º 40
0
 public virtual void OnCustom(CustomEventArgs args)
 {
 }
Exemplo n.º 41
0
 public void TriggerGenericEvent(CustomEventArgs args)
 {
     this.OnServerEventWithCustomArgs(args);
 }
Exemplo n.º 42
0
        private static void LogMqttRequestMessages(CustomEventArgs customEventArgs)
        {
            string msg = customEventArgs.ReceivedMessage.ToString();

            Console.WriteLine(msg);
        }
Exemplo n.º 43
0
 private void AliquotOrderSelectionPage_AliquotOrderSelected(object sender, CustomEventArgs.AliquotOrderReturnEventArgs eventArgs)
 {
     this.HandleAliquotOrderFound(eventArgs.AliquotOrder);
 }
Exemplo n.º 44
0
 static void PublishedMessage_NotifyEvent(CustomEventArgs customEventArgs)
 {
     string msg = customEventArgs.ReceivedMessage;
 }
Exemplo n.º 45
0
 private void CuttingPage_ShowTestOrderSelectionPage(object sender, CustomEventArgs.AliquotOrderReturnEventArgs eventArgs)
 {
     this.ShowTestOrderSelectionPage(eventArgs.AliquotOrder);
 }
Exemplo n.º 46
0
 static void SubscribedMessage_NotifyEvent(CustomEventArgs customEventArgs)
 {
     string msg = customEventArgs.ReceivedMessage;
 }
Exemplo n.º 47
0
 public void DummyAddMethod(object o, CustomEventArgs h)
 {
 }
Exemplo n.º 48
0
 public void ApplyCustom(IResourceContext rc, CustomEventArgs ev)
 {
     Called++;
 }
Exemplo n.º 49
0
        private void View_MaterialChanged(object sender, CustomEventArgs e)
        {
            var name = e.Data.ToString();

            model.SetSelectedMaterial(name);
        }
Exemplo n.º 50
0
 public async Task ApplyCustom(IResourceContext rc, CustomEventArgs ev)
 {
     await Task.Run(() => Called ++);
 }
Exemplo n.º 51
0
 internal void OnTreeGrown(CustomEventArgs args) => this.TreeGrown?.Invoke(this, args);
Exemplo n.º 52
0
        private void OnCustomEvent(object?sender, CustomEventArgs e)
        {
            var(@namespace, key) = e.EventKey;

            // Check that the event should be handled by this mod
            if (@namespace != this.manifest.UniqueID)
            {
                return;
            }

            // Handle the event based on the key
            switch (key)
            {
            case "LostBook":
            {
                Game1.showGlobalMessage(
                    "You found a lost book. The library has been expanded."
                    );
                break;
            }

            case "RandomGoldenWalnut" when Game1.IsMultiplayer:
            {
                e.Catch.FishingInfo.User.team.RequestLimitedNutDrops(
                    "IslandFishing",
                    e.Catch.FishingInfo.User.currentLocation,
                    (int)e.Catch.FishingInfo.BobberPosition.X,
                    (int)e.Catch.FishingInfo.BobberPosition.Y,
                    5
                    );
                break;
            }

            case "RandomGoldenWalnut":
            {
                if (!e.Catch.FishingInfo.User.team.limitedNutDrops.ContainsKey("IslandFishing"))
                {
                    e.Catch.FishingInfo.User.team.limitedNutDrops["IslandFishing"] = 1;
                }
                else
                {
                    ++e.Catch.FishingInfo.User.team.limitedNutDrops["IslandFishing"];
                }

                break;
            }

            case "TidePoolGoldenWalnut"
                when e.Catch.FishingInfo.User.currentLocation is IslandSouthEast location &&
                !location.fishedWalnut.Value:
            {
                e.Catch.FishingInfo.User.team.MarkCollectedNut("StardropPool");
                if (!Game1.IsMultiplayer)
                {
                    location.fishedWalnut.Value = true;
                }
                else
                {
                    location.fishWalnutEvent.Fire();
                }

                break;
            }
            }
        }
Exemplo n.º 53
0
 void myClass_RaiseCustomEvent(object sender, CustomEventArgs e)
 {
     this.Text = ((CustomEventArgs)e).Message;
 }
Exemplo n.º 54
0
 /// <summary>
 /// Raises the event.
 /// </summary>
 /// <param name="myAction">My action.</param>
 /// <param name="args">Arguments.</param>
 public static void RaiseEvent(this MyPackage.EventHandler <CustomEventArgs> myEvent, CustomEventArgs args)
 {
     if (myEvent != null)
     {
         myEvent.Invoke(myEvent, args);
     }
 }
 void NotificationServiceOnPushAccepted(object sender, CustomEventArgs<string> e)
 {
     tbPushContent.Text = e.Result ?? "*no content*";
     tbUserData.Text = ((PhonePushApplicationService) PhoneApplicationService.Current).NotificationService.UserData ?? "*no content*";
 }
Exemplo n.º 56
0
 public void ServerEventWithCustomArgs(CustomEventArgs args) => this.GenericServerEventRaised?.Invoke(args);
Exemplo n.º 57
0
    //--------обрабатываем события
    public void OnEvent(CustomEventArgs messageData)
    {
        var message = messageData.Message;

        switch (message)
        {
        case GameEventName.GoOpenPlaceInSlot when _flagPopup:
            return;

        case GameEventName.GoOpenPlaceInSlot:
        {
            _popupPlaceInSlot.transform.SetAsLastSibling();
            _popupPlaceInSlot.SetActive(true);
            var cardDisplay = _cardView.GetComponent <ActionsWithCards>();
            _cardGame = messageData.Value as ICard;
            cardDisplay.СhangeCardType(_cardGame);
            cardDisplay.CardGame.DisplayCardInGame(_cardView);
            _fullDescription.text = _cardGame.GetDataCard().FullDescription;
            _flagPopup            = true;
            break;
        }

        case GameEventName.GoClosePlaceInSlot when !_flagPopup:
            return;

        case GameEventName.GoClosePlaceInSlot:
            _popupPlaceInSlot.SetActive(false);
            _flagPopup      = false;
            _flagUnEqupment = false;
            break;

        case GameEventName.GoSelectCardInInventory when !_flagPopup:
            return;

        case GameEventName.GoSelectCardInInventory when !_flagUnEqupment:
            _publisher.Publish(_popupPlaceInSlot, new CustomEventArgs(GameEventName.GoEquipmentCard, _cardGame));
            _popupPlaceInSlot.SetActive(false);
            _flagPopup = false;
            break;

        case GameEventName.GoSelectCardInInventory:
            _publisher.Publish(_popupPlaceInSlot, new CustomEventArgs(GameEventName.GoUnequipmentCard, _cardGame));
            _popupPlaceInSlot.SetActive(false);
            _flagPopup      = false;
            _flagUnEqupment = false;
            break;

        case GameEventName.GoOpenUnequipmentSlot when _flagPopup:
            return;

        case GameEventName.GoOpenUnequipmentSlot:
        {
            _popupPlaceInSlot.transform.SetAsLastSibling();
            _popupPlaceInSlot.SetActive(true);
            var cardDisplay = _cardView.GetComponent <ActionsWithCards>();
            _cardGame = messageData.Value as ICard;
            cardDisplay.СhangeCardType(_cardGame);
            cardDisplay.CardGame.DisplayCardInGame(_cardView);
            _fullDescription.text = _cardGame.GetDataCard().FullDescription;
            _flagPopup            = true;
            _flagUnEqupment       = true;
            break;
        }
        }
    }
Exemplo n.º 58
0
    public void OnEvent(CustomEventArgs messageData)
    {
        var message = messageData.Message;

        switch (message)
        {
        case GameEventName.GoStageAddCardSpell:
            _coroutiner.StartCoroutine(SpawnCardsByType(CardType.Spell,
                                                        DropChance.ChanceSpell, DropChance.StartСhanceRarity, 3));
            break;

        case GameEventName.GoStageAddCardConsumables:
            _coroutiner.StartCoroutine(SpawnCardsByType(CardType.Consumables,
                                                        DropChance.ChanceConsumables, DropChance.StartСhanceRarity, 3));
            break;

        case GameEventName.GoStageAddCardArea:
            _coroutiner.StartCoroutine(SpawnCardArea());
            break;

        case GameEventName.GoStageAddCardEvent:
            _coroutiner.StartCoroutine(SpawnCardEvent());
            break;

        case GameEventName.GoStageAddCardEnemy:
            _coroutiner.StartCoroutine(SpawnCardEnemy());
            break;

        case GameEventName.GoStageRandomEvent:
            _coroutiner.StartCoroutine(StartRandomEvent());
            break;

        case GameEventName.GoSelectCardEnemy:
        {
            foreach (var card in _poolCardEnemy)
            {
                if (!card.activeSelf)
                {
                    continue;
                }
                var cardDisplay = card.GetComponent <ActionsWithCards>();
                _selectedCardUnit = cardDisplay.CardGame;
                break;
            }
            _coroutiner.StartCoroutine(PreparationStageBattle());
            //_coroutiner.StartCoroutine(SpawnCardsInHand());
            break;
        }

        case GameEventName.GoSummonAllies:
            _selectedCardUnit = messageData.Value as ICard;
            SpawnAllies();
            break;

        case GameEventName.GoStageBattle:
            _publisher.Publish(null, new CustomEventArgs(GameEventName.GoNextTurn));
            break;

        case GameEventName.GoFinishBattle:
            FinishBattle();
            break;

        case GameEventName.GoRewardEvent:
            _coroutiner.StartCoroutine(EndRandomEvent(0.7f));
            break;

        case GameEventName.GoOpenPopupWithDescriptionCard:
        {
            ReturnNoSelectedCard(_poolGameCard);
            var cardGame = messageData.Value;
            _publisher.Publish(_hud, new CustomEventArgs(GameEventName.GoSetNextStage, cardGame));
            break;
        }

        case GameEventName.GoOpenPopupNoDescription:
        {
            ReturnNoSelectedCard(_poolCardArea);
            ReturnNoSelectedCard(_poolCardEvent);
            ReturnNoSelectedCard(_poolCardEnemy);
            var cardGame = messageData.Value;
            _publisher.Publish(_hud, new CustomEventArgs(GameEventName.GoSetNextStage, cardGame));
            break;
        }

        case GameEventName.GoDeadEnemy:
            var objCard = messageData.Value as GameObject;
            _configurateManager.ConfigurateByParent(objCard, _hud, false);
            break;

            /*case GameEventName.GoEndTurnPlayer:
             *  foreach (var card in _poolCardsPlayer)
             *  {
             *      var component = card.GetComponent<DraggableCard>();
             *      component.enabled = false;
             *  }
             *  break;
             * case GameEventName.GoEndTurnEnemy:
             *  foreach (var card in _poolCardsPlayer)
             *  {
             *      var component = card.GetComponent<DraggableCard>();
             *      component.enabled = true;
             *  }
             *  break;*/
        }
    }
Exemplo n.º 59
0
 private void OrderTargetSelectionPage_TargetSelected(object sender, CustomEventArgs.TestOrderInfoEventArgs e)
 {
     this.m_FlowUI.PanelSetOrderLeukemiaLymphoma.OrderedOnId = e.TestOrderInfo.OrderTarget.GetId();
     this.m_FlowUI.PanelSetOrderLeukemiaLymphoma.OrderedOn = e.TestOrderInfo.OrderTarget.GetOrderedOnType();
     this.m_LoginPageWindow.Close();
 }
 void NotificationServiceOnPushAccepted(object sender, CustomEventArgs <string> e)
 {
     tbPushContent.Text = e.Result ?? "*no content*";
     tbUserData.Text    = ((PhonePushApplicationService)PhoneApplicationService.Current).NotificationService.UserData ?? "*no content*";
 }