示例#1
0
文件: Program.cs 项目: vaf888/studies
        static void Main(string[] args)
        {
            General g = new General();

            Console.WriteLine("__________________________________");
            g.HelloWorld();

            //Console.WriteLine("__________________________________");
            //g.GetUserInput();

            Console.WriteLine("__________________________________");
            g.TestStrings();

            Console.WriteLine("__________________________________");
            g.TestArrays();

            Console.WriteLine("__________________________________");
            g.Variables();

            Console.WriteLine("__________________________________");
            Student s = new Student();

            s.Name = "Antonio";
            s.Age  = 20;
            Console.WriteLine(s.AsString());

            Console.WriteLine("__________________________________");
            //using static polymorphism
            s.print(5);
            s.print(123.45);

            Console.WriteLine("__________________________________");
            //dynamic polymorphism
            Shape sh = new Rectangle(10, 20);

            Console.WriteLine("-> Area={0}", sh.Area());

            Console.WriteLine("__________________________________");
            //interfaces
            TextBox tb   = new TextBox();
            IDelete iDel = tb;

            iDel.Delete();

            Car c = new Car();

            iDel = c;
            iDel.Delete();
        }
示例#2
0
 public void Delete(TEntity entity)
 {
     if (this.Confirm(message))
     {
         decoratedCrud.Delete(entity);
     }
 }
示例#3
0
        public void Delete(TEntity entity)
        {
            decorated.Delete(entity);
            var entityDeleted = new EntityDeletedEvent <TEntity>(entity);

            eventPublisher.Publish(entityDeleted);
        }
示例#4
0
 public void Delete()
 {
     if (!_entity.IsFirstRun())
     {
         _outputDeleter.Delete(DetermineDeletes());
     }
 }
 public void Delete()
 {
     if (_context.Process.Mode != "init")
     {
         _outputDeleter.Delete(DetermineDeletes());
     }
 }
示例#6
0
    public void Delete <T>(object id)
    {
        var item = getter.GetById <T>(id);

        nextDelete.Delete <T>(id);
        publisher.PublishDelete(item);
    }
示例#7
0
 public void Delete()
 {
     if (!_context.Entity.IsFirstRun)
     {
         _outputDeleter.Delete(DetermineDeletes());
     }
 }
示例#8
0
 public void Delete(TEntity entity)
 {
     if (userInteraction.Confirm("Are you shure you wnt to delete this entity?"))
     {
         decoratedDelete.Delete(entity);
     }
 }
示例#9
0
 public void Delete(int key)
 {
     if (ConfirmDelete(key))
     {
         _deleteImpl.Delete(key);
     }
 }
示例#10
0
 public void Delete(TEntity entity)
 {
     if (this.userInteraction.Confirm("Are you sure you want to delete de entry ?"))
     {
         decoratedCrud.Delete(entity);
     }
 }
示例#11
0
        /// <summary>
        /// Delete entity.
        /// </summary>
        /// <param name="id">Identifier entity to delete.</param>
        public void Delete(int id)
        {
            if (_deleter == null)
            {
                _deleter = GetRepositoryFactory().CreateDeleter();
            }

            _deleter.Delete(id);
        }
示例#12
0
        public void DeletePersistancyTest()
        {
            Delete.Delete("Tasks", 232);

            int myValue   = 42;
            int realValue = CollectionsClass.LoadToDo().Count;

            Assert.AreEqual(myValue, realValue);    //Passed
        }
        public void Delete(TEntity entity)
        {
            Console.WriteLine("Are you sure you want to delete the entity?(y/N)");
            var keyInfo = Console.ReadKey();

            if (keyInfo.Key == ConsoleKey.Y)
            {
                decoratedCrud.Delete(entity);
            }
        }
示例#14
0
        public void RemoveNoteTest()
        {
            NoteVm.SelectedNote.NotesId = 34;

            Delete.Delete("Notes", NoteVm.SelectedNote.NotesId);

            int myValue   = 4;
            int realValue = Collection.LoadNotes().Count;

            Assert.AreEqual(myValue, realValue); //passed
        }
        public void Delete(TEntity entity)
        {
            Console.WriteLine("Are you sure you want to delete items");
            var keyInfo = Console.ReadKey();

            if (keyInfo.Key == ConsoleKey.Y)
            {
                using (var transaction = new TransactionScope())
                {
                    decoratedDeleteOperation.Delete(entity);
                    transaction.Complete();
                }
            }
        }
示例#16
0
        public async void RemoveNote()
        {
            if (_noteVm.SelectedNote.NotesId != 0)
            {
                await _deleteNote.Delete("Notes", _noteVm.SelectedNote.NotesId);

                FrameNavigateClass _frame = new FrameNavigateClass();
                _frame.ActivateFrameNavigation(typeof(MenuPage));
                MessageDialog msg = new MessageDialog("Note deleted!");
                await msg.ShowAsync();
            }
            else
            {
                MessageDialog msg = new MessageDialog("Please select the note.");
                await msg.ShowAsync();
            }
        }
示例#17
0
        public async void DeleteTask(int key)
        {
            if (_deleteVm.SelectedItem != null)
            {
                await _delete.Delete("Tasks", key);

                _frame.ActivateFrameNavigation(typeof(MenuPage));

                var msg = new MessageDialog("Task deleted");
                await msg.ShowAsync();
            }
            else
            {
                var msg = new MessageDialog("Please select the task");
                await msg.ShowAsync();
            }
        }
示例#18
0
 public void Delete(int key)
 {
     _delete.Delete(key);
 }
示例#19
0
 public void DeleteItem(Item item)
 {
     deleter.Delete(item);
     Console.WriteLine("DeleteItem: Delete item of " + item.product);
 }
 public void Delete(TEntity entity)
 {
     deleter.Delete(entity);
 }
示例#21
0
 public void DeleteOrder(Item itm)
 {
     deleter.Delete(itm);
     Console.WriteLine("DeleteOrder: Delete item of " + itm.product);
 }
示例#22
0
 public void DeleteEntity(TEntity entity)
 {
     deleter.Delete(entity);
     Console.WriteLine("DeleteEntity: Delete entity");
 }
 public void DeleteOrder(Item order)
 {
     deleter.Delete(order);
     Console.WriteLine("DeleteOrder: Delete order of " + order.product);
 }
示例#24
0
 public void RemoveUser(string userId)
 {
     _userRemover.Delete(userId);
 }
示例#25
0
 public void Delete <T>(object id)
 {
     deleter.Delete <T>(id);
 }
 public void DeleteOrder(Order order)
 {
     deleter.Delete(order);
 }
示例#27
0
 public void Execute(object parameter)
 {
     _deleteTarget.Delete(_viewModel);
 }
示例#28
0
 public void DeleteOrder(Order order)
 {
     orderDelete.Delete(order);
 }