Exemple #1
0
 private void OnDeleteCallback(DeleteCallback deleteCallback)
 {
     connection.Send(new RpcRequest <TMarshal>()
     {
         DeleteCallback = deleteCallback
     });
 }
		public InputMachine()
		{
			this.currentState = State.idle;
			this.currentCharSet = null;
			this.currentIndex = 0;

			this.selectionCallback = null;
			this.addCharacterCallback = null;
			this.deleteCallback = null;
		}
        public void DeletionFails()
        {
            var mock = new Mock <IConnectionAvailability>();

            mock.SetupGet(_ => _.IsOpen).Returns(false);
            var executor = new CallbackExecutor <object>(Mock.Of <IIdGenerator>(), mock.Object, Mock.Of <IObservable <CallbackResult <object> > >());

            DeleteCallback delete = null;

            ((IObservable <DeleteCallback>)executor).Subscribe(
                deleteCallback => delete = deleteCallback);

            Assert.Throws <InvalidOperationException>(() => executor.DeleteCallback(1));
        }
        public void CallbackDeleted()
        {
            var mock = new Mock <IConnectionAvailability>();

            mock.SetupGet(_ => _.IsOpen).Returns(true);
            var executor = new CallbackExecutor <object>(Mock.Of <IIdGenerator>(), mock.Object, Mock.Of <IObservable <CallbackResult <object> > >());

            DeleteCallback delete = null;

            ((IObservable <DeleteCallback>)executor).Subscribe(
                deleteCallback => delete = deleteCallback);

            executor.DeleteCallback(1);

            Assert.Equal(1, delete.FunctionId);
        }
Exemple #5
0
        private bool Delete(long note_id, bool isAsync, DeleteCallback callback, Object state)
        {
            var parameterList = new Dictionary <string, string> {
                { "method", "facebook.notes.delete" }
            };

            Utilities.AddRequiredParameter(parameterList, "note_id", note_id);

            if (isAsync)
            {
                SendRequestAsync <notes_delete_response, bool>(parameterList, !string.IsNullOrEmpty(Session.SessionKey), new FacebookCallCompleted <bool>(callback), state);
                return(true);
            }

            var response = SendRequest <notes_delete_response>(parameterList, !string.IsNullOrEmpty(Session.SessionKey));

            return(response == null ? false : response.TypedValue);
        }
Exemple #6
0
        protected override void DataDelete(object arg, DeleteCallback callback)
        {
            try
            {
                DataMap data = new DataMap()
                {
                    { "CAL_DATE", datCalDate.GetDateChar8() },
                    { "ROWSTATE", "DELETE" }
                };

                var res = DBTranHelper.Execute(new DBTranSet()
                {
                    ServiceId     = "Base",
                    ProcessId     = "Save",
                    IsTransaction = true,
                    TranList      = new DBTranData[]
                    {
                        new DBTranData()
                        {
                            SqlId    = "Calendar",
                            KeyField = "CAL_DATE",
                            Data     = data
                        }
                    }
                });

                if (res.ErrorNumber != 0)
                {
                    throw new Exception(res.ErrorMessage);
                }

                ShowMsgBox("저장하였습니다.");
                callback(arg, res.TranList[0].ReturnValue);
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Exemple #7
0
        protected override void DataDelete(object arg, DeleteCallback callback)
        {
            try
            {
                DataMap data = new DataMap()
                {
                    { "ADJS_ID", txtAdjsId.EditValue },
                    { "ROWSTATE", "DELETE" }
                };

                var res = DBTranHelper.Execute("InvAdjs", "Save", data, null);
                if (res.ErrorNumber != 0)
                {
                    throw new Exception(res.ErrorMessage);
                }

                ShowMsgBox("삭제하였습니다.");
                callback(arg, null);
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
Exemple #8
0
        protected override void DataDelete(object arg, DeleteCallback callback)
        {
            try
            {
                DataMap map = new DataMap()
                {
                    { "PURC_ID", txtPurcId.EditValue },
                    { "ROWSTATE", "DELETE" }
                };

                var res = DBTranHelper.Execute("Purchase", "Delete", map, null);
                if (res.ErrorNumber != 0)
                {
                    throw new Exception(res.ErrorMessage);
                }

                ShowMsgBox("삭제하였습니다.");
                callback(arg, null);
            }
            catch (Exception ex)
            {
                ShowErrBox(ex);
            }
        }
		public void registerDeleteCallback(DeleteCallback cb)
		{
			this.deleteCallback = cb;
		}
Exemple #10
0
 /// <summary>
 /// 데이터 삭제 메소드
 /// 파라미터로 처리된 콜백 메소드를 호출한다.
 /// </summary>
 /// <param name="arg"></param>
 /// <param name="callback"></param>
 protected virtual void DataDelete(object arg, DeleteCallback callback)
 {
     callback?.Invoke(arg, null);
 }
Exemple #11
0
 /// <summary>
 /// Lets a user delete a Facebook note that was written through your application.
 /// </summary>
 /// <example>
 /// <code>
 /// private static void RunDemoAsync()
 /// {
 ///     Api api = new Api(new DesktopSession(Constants.ApplicationKey, Constants.ApplicationSecret, Constants.ApplicationSecret, Constants.SessionKey));
 ///     api.Notes.DeleteAsync(Constants.NoteId, AsyncDemoCompleted, null);
 /// }
 ///
 /// private static void AsyncDemoCompleted(bool result, Object state, FacebookException e)
 /// {
 ///     var actual = result;
 /// }
 /// </code>
 /// </example>
 /// <param name="note_id">The ID of the note to delete.</param>
 /// <param name="callback">The AsyncCallback delegate</param>
 /// <param name="state">An object containing state information for this asynchronous request</param>
 /// <returns>This method returns true if successful.</returns>
 public void DeleteAsync(long note_id, DeleteCallback callback, Object state)
 {
     Delete(note_id, true, callback, state);
 }
Exemple #12
0
 internal static extern ErrorCode SetShortcutDeleteCallback(DeleteCallback cb, IntPtr data);