示例#1
0
        virtual protected void onClicked()
        {
            BasicEventArgs arg = new BasicEventArgs();

            arg.objParam1 = gameObject;
            this.DispatchEvent(EventID.ID_EVENT_BUTTON_CLICK, arg);
        }
示例#2
0
        private async Task OnFlushed(object source, BasicEventArgs e)
        {
            if (Flushed == null)
            {
                return;
            }

            await Flushed.Invoke(source, e);
        }
示例#3
0
        private async Task OnLog(object source, BasicEventArgs e)
        {
            if (Log == null)
            {
                return;
            }

            await Log.Invoke(this, e);
        }
示例#4
0
        private async Task OnFailure(object source, BasicEventArgs e)
        {
            if (Failure == null)
            {
                return;
            }

            await Failure.Invoke(this, e);
        }
示例#5
0
        public static void Query(this SqliteConnection source, BasicEventArgs e)
        {
            source.Open();

            using (SqliteTransaction transaction = source.BeginTransaction()) {
                using (SqliteCommand command = source.CreateCommand()) {
                    command.Transaction = transaction;
                    command.CommandText = e.Contents;
                    command.ExecuteNonQuery();
                }

                transaction.Commit();
            }
        }
示例#6
0
        public static async Task QueryAsync(this SqliteConnection source, BasicEventArgs e)
        {
            await source.OpenAsync();

            using (SqliteTransaction transaction = source.BeginTransaction()) {
                using (SqliteCommand command = source.CreateCommand()) {
                    command.Transaction = transaction;
                    command.CommandText = e.Contents;
                    await command.ExecuteNonQueryAsync();
                }

                transaction.Commit();
            }
        }
示例#7
0
 public void DispatchEvent(string strEventID, BasicEventArgs e)
 {
     e.sender = this;
     EventHandler.DispatchEvent(strEventID, e);
 }
示例#8
0
        public void BasicEventArgsIdCanBeGetedAndIsSame(object id)
        {
            var actualInstance = new BasicEventArgs(id);

            Assert.AreEqual(actualInstance.Id, id);
        }
示例#9
0
        public void BasicEventArgsTestsCorectly_NewInstanceIsCreatedOfSameType()
        {
            var actualInstance = new BasicEventArgs(It.IsAny <string>());

            Assert.IsInstanceOf(typeof(BasicEventArgs), actualInstance);
        }
示例#10
0
        public void BasicEventArgsTestsCorectly_NewInstanceIsCreated()
        {
            var actualInstance = new BasicEventArgs(It.IsAny <string>());

            Assert.That(actualInstance, Is.Not.Null);
        }