Exemplo n.º 1
0
        static void ExecuteCommand(BoardContainerBase container, ContainerCommand command, int bulletinId)
        {
            _DCT.Execute((data) =>
            {
                switch (command)
                {
                case ContainerCommand.Publish:
                    container.AddBulletin(null, null);
                    break;

                case ContainerCommand.Edit:
                    container.EditBulletin(null);
                    break;

                case ContainerCommand.Update:
                    container.UpdateBulletin();
                    break;

                case ContainerCommand.Disable:
                    container.CloseBulletin();
                    break;

                case ContainerCommand.ShowStatistics:
                    container.GetStats();
                    break;
                }
            }, _DCTGroup.BulletinContainerList);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Получаем контейнер по UID
        /// </summary>
        /// <param name="container"></param>
        public static BoardContainerBase Get(string uid)
        {
            BoardContainerBase result = null;

            _DCT.Execute((data) =>
            {
                result = containerList.FirstOrDefault(q => q.Uid == uid);
            }, _DCTGroup.BulletinContainerList);
            return(result);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Добавляем новый контейнер
 /// </summary>
 /// <param name="container"></param>
 public static void Add(BoardContainerBase container)
 {
     _DCT.Execute((data) =>
     {
         if (containerList.Any(q => container.Uid == q.Uid))
         {
             throw new Exception("IBulletinContainer уже добавлен, UID контейнера " + container.Uid);
         }
         containerList.Add(container);
     }, _DCTGroup.BulletinContainerList);
 }