Ejemplo n.º 1
0
        public PlayerRegistrationLobby()
        {
            StatusTimer = new OneShotTimer(5 * 1000 * 1000, false);

            m_maxPlayers = 2;

            Status         = CreateStatusDrawString();
            Status.Visible = false;
            Strings.Add(Status);
            Strings.Add(new DrawableString(new DrawingOptions()
            {
                Position = new Vector2(117, 50)
            }, "Press <Delete> to remove a player."));

            RegistrationSelection = new RegistrationOptions();
            RegisteredPlayers     = new List <PlayerEntry>();

            RegistrationSelection.TopLeft = new Vector2(100, 130);
            StringAddPlayerEntry          = CreateAddPlayerStringEntry();
            InsertAddPlayerString();

            OnAddPlayerSelection();

            UpdateEntryPositions();

            Lists.Add(RegistrationSelection);
        }
Ejemplo n.º 2
0
    public static Lists operator +(Lists l1, Lists l2) //перегрузка оператора
    {
        var UnitedList = new Lists();

        for (int i = 0; i < l1.Count(); i++)
        {
            int element = l1.Element(i);
            UnitedList.Add(element);
        }
        for (int i = 0; i < l2.Count(); i++)
        {
            int element = l2.Element(i);
            UnitedList.Add(element);
        }
        return(UnitedList);
    }
Ejemplo n.º 3
0
        private void InitCommand()
        {
            SyncBucketInfo = new DelegateCommand((obj) =>
            {
                int count = Service.SyncBucketInfo();
                MessageBox.Show($"成功更新【{count}】条桶子名称");
            });

            ModifyCommand = new DelegateCommand((obj) =>
            {
                var cloneData           = ObjectDeepCopyHelper <BucketModel, BucketModel> .Trans(BucketSelectedItem);
                BucketModifyWindow view = new BucketModifyWindow();
                (view.DataContext as BucketModifyViewModel).WithParam(cloneData, (type, outputEntity, IsChanged) =>
                {
                    view.Close();
                    if (type == 1)
                    {
                        Service.BucketModify(outputEntity);
                        //if(IsChanged)
                        QueryBaseCommand.Execute(null);
                    }
                });
                view.ShowDialog();
            });

            QueryBaseCommand = new DelegateCommand((obj) =>
            {
                Lists.Clear();
                Service.GetLists($" and FName like '%{BucketName}%'").ForEach(x => Lists.Add(x));
            });
        }
        void LoadLists(System.Action continueWith = null)
        {
            Lists.Clear();

            if (!IsSharepointServerSelected)
            {
                if (continueWith != null)
                {
                    continueWith();
                }
                return;
            }

            // Get Selected values on UI thread BEFORE starting asyncWorker
            var selectedDatabase = SelectedSharepointServer;

            _asyncWorker.Start(() => GetSharepointLists(selectedDatabase), tableList =>
            {
                if (tableList != null)
                {
                    foreach (var listTo in tableList.OrderBy(t => t.FullName))
                    {
                        Lists.Add(listTo);
                    }
                }
                if (continueWith != null)
                {
                    continueWith();
                }
            });
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Imports the specified module into the sprite.
        /// </summary>
        /// <param name="module">The module to import.</param>
        public void Import(ModuleDeclaration module)
        {
            // Constants
            foreach (ConstDeclaration constant in module.Constants)
            {
                Constants.Add(constant);
            }

            // Variables
            foreach (GlobalVarDeclaration variable in module.Variables)
            {
                Variables.Add(variable);
            }

            // Lists
            foreach (GlobalListDeclaration list in module.Lists)
            {
                Lists.Add(list);
            }

            // Event handlers
            foreach (EventHandler scope in module.EventHandlers)
            {
                EventHandlers.Add(scope);
            }

            // Methods
            foreach (MethodDeclaration method in module.Methods)
            {
                Methods.Add(method);
            }
        }
Ejemplo n.º 6
0
        private void SetData(DataBase data)
        {
            try
            {
                AdvContext.Current.Data = data;
                _data  = data;
                Status = _data.FileName;
                OnPropertyChanged("Status");

                _phones       = new PhonesListView(data.Phones);
                _manufaturers = new TextListView("Производители", data.WheelsManufaturers);
                _logins       = new LoginListView(data.Logins, _logWriter);
                _wheels       = new WheelsListView(data)
                {
                    Phones        = _phones.Items,
                    Manufacturers = _manufaturers.Items
                };
                Lists.Clear();
                Lists.Add(_logins);
                Lists.Add(_phones);
                Lists.Add(_manufaturers);
                Lists.Add(_wheels);
            }
            catch (Exception ex)
            {
                _logWriter.LogDebug(ex.ToString());
            }
        }
Ejemplo n.º 7
0
        private async void Create()
        {
            try
            {
                var setNamePopupPage = new SetNamePopupPage()
                {
                    Header = "List Name",
                    Body   = "Set a list name"
                };

                await _popupNavigation.PushAsync(setNamePopupPage);

                string name = await setNamePopupPage.Task;

                ToDoList newList = new ToDoList
                {
                    Id   = Guid.NewGuid(),
                    Name = name
                };

                await _toDoService.CreateList(newList);

                Lists.Add(newList);

                await Navigation.PushAsync <ItemsPage, ItemsPageModel>(x => x.Init(newList));
            }
            catch (OperationCanceledException)
            {
                Debug.WriteLine("User cancelled setting name");
            }
            catch (Exception ex)
            {
                Debug.Fail("Error creating list", ex.Message);
            }
        }
Ejemplo n.º 8
0
        private void ReceiveLists(IEnumerable <TwitterList> result, TwitterResponse response)
        {
            lock (sync)
            {
                loading--;

                if (loading <= 0)
                {
                    IsLoading = false;
                    BarText   = "";
                    reloadLists.RaiseCanExecuteChanged();
                }
            }

            if (response.StatusCode != HttpStatusCode.OK)
            {
                MessageService.ShowError(Localization.Resources.ErrorLoadingLists);
            }

            foreach (var list in result)
            {
                if (!Lists.Any(x => x.FullName == list.FullName))
                {
                    Lists.Add(list);
                }
            }
        }
Ejemplo n.º 9
0
        private static double?GeometricMeanOfOffset(IList <double> set)
        {
            double         min     = Math.Abs(Minimum(set).Value) + 1.0;
            IList <double> dataset = Lists.GetCopy(set);

            Lists.Add(dataset, min);
            return(Mathematics.Root(Lists.Product(dataset), dataset.Count) - min);
        }
Ejemplo n.º 10
0
 public void UpdateLists(ICollection <SpiritListViewModel> spirits)
 {
     Lists.Clear();
     foreach (var sp in spirits)
     {
         Lists.Add(sp);
     }
 }
Ejemplo n.º 11
0
        private void OnButtonAddList(object obj)
        {
            TaskList createdList = new TaskList("new List", "description");

            Lists.Add(createdList);
            SelectedList = createdList;

            EnableInputRequest(this, true);
        }
Ejemplo n.º 12
0
        private static double?GeneralizedOfOffset(IList <double> set, int rank)
        {
            double         absMin = Math.Abs(Minimum(set).Value) + 1.0;
            IList <double> powers = Lists.GetCopy(set);

            Lists.Add(powers, absMin);
            Lists.Exponentiate(powers, rank);
            return(Mathematics.Root(Lists.Sum(powers) / set.Count, rank) - absMin);
        }
Ejemplo n.º 13
0
        public void Add_WhenValidValues_AddLast(int value, int[] actualArray, int[] expectedArray)
        {
            Lists actual   = new Lists(actualArray);
            Lists expected = new Lists(expectedArray);

            actual.Add(value);

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 14
0
        private static double?HarmonicOfOffset(IList <double> set)
        {
            double         absMin      = Math.Abs(Minimum(set).Value) + 1.0;
            IList <double> reciprocals = Lists.GetCopy(set);

            Lists.Add(reciprocals, absMin);
            Lists.Reciprocal(reciprocals);
            return((set.Count / Lists.Sum(reciprocals)) - absMin);
        }
Ejemplo n.º 15
0
        protected Container AddList(ListContent list)
        {
            if (Lists == null)
            {
                Lists = new List <ListContent>();
            }

            Lists.Add(list);
            return(this);
        }
Ejemplo n.º 16
0
        internal void CacheList(IList list)
        {
            var existingList = Lists.FirstOrDefault(l => l.Id == list.Id);

            if (existingList != null)
            {
                Lists.Remove(existingList);
            }
            list.EnsureProperties(l => l.RootFolder);
            Lists.Add(list);
        }
Ejemplo n.º 17
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="model"></param>
        /// <param name="Index"></param>
        private void AddList(MainListModel model, int Index = -1)
        {
            if (Index != -1)
            {
                Lists.Insert(Index, model);
            }
            else
            {
                Lists.Add(model);
            }

            AddSelectedItem(model, Index);
        }
Ejemplo n.º 18
0
 public void Add(string name, string url)
 {
     foreach (var item in Lists)
     {
         if (item.Name == name)
         {
             throw new Exception(Strings.UrlExists);
         }
     }
     Lists.Add(new UrlObject()
     {
         Name = name, URL = url
     });
 }
Ejemplo n.º 19
0
        protected override async Task NavigatedToAsync(CancellationToken cancelToken, NavigatedToEventArgs e, Dictionary <string, object> viewModelState)
        {
            while (HohoemaApp.FollowManager == null)
            {
                await Task.Delay(100);
            }

            Lists.Clear();

            if (!HohoemaApp.FollowManagerUpdater.IsOneOrMoreUpdateCompleted)
            {
                await HohoemaApp.FollowManagerUpdater.WaitUpdate();
            }

            Lists.Add(new FavoriteListViewModel(HohoemaApp.FollowManager)
            {
                Name         = "ユーザー",
                FavType      = FollowItemType.User,
                MaxItemCount = HohoemaApp.FollowManager.User.MaxFollowItemCount,
                Items        = HohoemaApp.FollowManager.User.FollowInfoItems
                               .ToReadOnlyReactiveCollection(x => new FavoriteItemViewModel(x, HohoemaApp.FollowManager, PageManager))
            });

            Lists.Add(new FavoriteListViewModel(HohoemaApp.FollowManager)
            {
                Name         = "マイリスト",
                FavType      = FollowItemType.Mylist,
                MaxItemCount = HohoemaApp.FollowManager.Mylist.MaxFollowItemCount,
                Items        = HohoemaApp.FollowManager.Mylist.FollowInfoItems
                               .ToReadOnlyReactiveCollection(x => new FavoriteItemViewModel(x, HohoemaApp.FollowManager, PageManager))
            });

            Lists.Add(new FavoriteListViewModel(HohoemaApp.FollowManager)
            {
                Name         = "タグ",
                FavType      = FollowItemType.Tag,
                MaxItemCount = HohoemaApp.FollowManager.Tag.MaxFollowItemCount,
                Items        = HohoemaApp.FollowManager.Tag.FollowInfoItems
                               .ToReadOnlyReactiveCollection(x => new FavoriteItemViewModel(x, HohoemaApp.FollowManager, PageManager))
            });

            Lists.Add(new FavoriteListViewModel(HohoemaApp.FollowManager)
            {
                Name         = "コミュニティ",
                FavType      = FollowItemType.Community,
                MaxItemCount = HohoemaApp.FollowManager.Community.MaxFollowItemCount,
                Items        = HohoemaApp.FollowManager.Community.FollowInfoItems
                               .ToReadOnlyReactiveCollection(x => new FavoriteItemViewModel(x, HohoemaApp.FollowManager, PageManager))
            });
        }
Ejemplo n.º 20
0
        protected override void CreateLists()
        {
            base.CreateLists();
            Lists[UsageListName].Items.Add(new ListItem("S - Save"));
            Lists[UsageListName].Items.Add(new ListItem("L - Load"));
            Lists[UsageListName].Items.Add(new ListItem("G - Collect Loot (while standing over it)"));

            var panelLeft = Console.WindowWidth - panelsWidth * 2 - OriginX;

            lastActionsPrinter = new ListPresenter("Last Actions", panelLeft, DungeonBottom, panelsWidth);
            Lists.Add(lastActionsPrinter.Caption, lastActionsPrinter);

            inventoryPresenter = new ListPresenter("Inventory", panelLeft, OriginY, panelsWidth);
            Lists.Add(inventoryPresenter.Caption, inventoryPresenter);
        }
        public async Task InitAsync()
        {
            if (!updateSocket.IsStarted)
            {
                await updateSocket.StartAsync();

                updateSocket.OnCheckListAdded(added => {
                    Lists.Add(_makeDisplay(added));
                });
                updateSocket.OnCheckListUpdated(updated
                                                => Lists[Lists.IndexOf(Lists.SingleOrDefault(l => l.Id == updated.Id))] = _makeDisplay(updated));
                updateSocket.OnCheckListDeleted(id => Lists.Remove(Lists.SingleOrDefault(l => l.Id == id)));
            }
            Lists = new ObservableCollection <CheckListDisplay>((await repository.GetAsync()).Select(c => _makeDisplay(c)));
            OnPropertyChanged(nameof(Lists));
        }
Ejemplo n.º 22
0
        protected override async Task OnSignIn(ICollection <IDisposable> userSessionDisposer, CancellationToken cancelToken)
        {
            if (Lists.Count == 0)
            {
                Lists.Add(new FavoriteListViewModel("ユーザー", HohoemaApp.FollowManager.User, HohoemaApp.FollowManager, PageManager));

                Lists.Add(new FavoriteListViewModel("マイリスト", HohoemaApp.FollowManager.Mylist, HohoemaApp.FollowManager, PageManager));

                Lists.Add(new FavoriteListViewModel("タグ", HohoemaApp.FollowManager.Tag, HohoemaApp.FollowManager, PageManager));

                Lists.Add(new FavoriteListViewModel("コミュニティ", HohoemaApp.FollowManager.Community, HohoemaApp.FollowManager, PageManager));

                Lists.Add(new FavoriteListViewModel("チャンネル", HohoemaApp.FollowManager.Channel, HohoemaApp.FollowManager, PageManager));
            }

            await base.OnSignIn(userSessionDisposer, cancelToken);
        }
Ejemplo n.º 23
0
        private void LoadList()
        {
            // Testing Data

            // ToDo AddReminder should maybe be moved to TimeControlledElement - then only add this way, the parent has to be right OR BETTER MAYBE OBSERVABLECOLLECTION OR SOMETHING SIMILAR!! THIS WOULD BE SOOOO COOOOL

            var tl = new TaskList("DailyToDos", "disc");

            tl.Tasks.Add(new UserTask("Essen", "Essen kaufen und dann super"));
            tl.Tasks.Add(new UserTask("Dunzo", "Ich bin ready"));
            tl.Tasks.FindLast(i => true).GetAllReminders(false).ForEach(t => t.Done = true);

            Lists.Add(tl);
            SelectedList = tl;

            Lists.Add(new TaskList("Birthdays", "Containging the Birthdates of friends."));
        }
Ejemplo n.º 24
0
        public async Task CreateNewListAsync()
        {
            try
            {
                var list = await _listsService.CreateListAsync(NewListName)
                           .ConfigureAwait(true);

                Lists.Add(list);

                NewListName = string.Empty;

                OnStateChanged();
            }
            catch (Exception ex)
            {
                await ShowErrorAsync(ex)
                .ConfigureAwait(true);
            }
        }
        public DefaultNHibernatePatternsHolder(IDomainInspector domainInspector, IExplicitDeclarationsHolder explicitDeclarations)
        {
            Poids.Add(new PoIdPattern());
            Sets.Add(new SetCollectionPattern());
            Bags.Add(new BagCollectionPattern());
            Lists.Add(new ListCollectionPattern(domainInspector));
            Arrays.Add(new ArrayCollectionPattern());
            Components.Add(new ComponentPattern(domainInspector));
            Dictionaries.Add(new DictionaryCollectionPattern());

            PoidStrategies.Add(new HighLowPoidPattern());
            PoidStrategies.Add(new GuidOptimizedPoidPattern());

            PersistentPropertiesExclusions.Add(new ReadOnlyPropertyPattern());
            ManyToOneRelations.Add(new OneToOneUnidirectionalToManyToOnePattern(domainInspector, explicitDeclarations));
            ManyToOneRelations.Add(new PolymorphicManyToOnePattern(domainInspector));
            OneToManyRelations.Add(new PolymorphicOneToManyPattern(domainInspector));
            HeterogeneousAssociations.Add(new HeterogeneousAssociationOnPolymorphicPattern(domainInspector));
        }
Ejemplo n.º 26
0
        public DefaultNHibernatePatternsHolder(IDomainInspector domainInspector, IExplicitDeclarationsHolder explicitDeclarations)
        {
            if (domainInspector == null)
            {
                throw new ArgumentNullException("domainInspector");
            }
            Poids.Add(new PoIdPattern());
            Sets.Add(new SetCollectionPattern());
            Bags.Add(new BagCollectionPattern());
            Lists.Add(new ListCollectionPattern(domainInspector));
            Arrays.Add(new ArrayCollectionPattern());
            Components.Add(new ComponentPattern(domainInspector));
            Dictionaries.Add(new DictionaryCollectionPattern());

            PoidStrategies.Add(new HighLowPoidPattern());
            PoidStrategies.Add(new GuidOptimizedPoidPattern());

            PersistentPropertiesExclusions.Add(new ReadOnlyPropertyPattern());
            ManyToOneRelations.Add(new OneToOneUnidirectionalToManyToOnePattern(explicitDeclarations));
        }
Ejemplo n.º 27
0
 /// <summary>
 /// 添加元素
 /// </summary>
 /// <param name="Key">唯一键</param>
 /// <param name="MatchName">匹配的Occurrence名称</param>
 /// <param name="EventType">事件枚举类型</param>
 /// <param name="Helper">文档事件帮助类</param>
 public void AddElement(object Key, string MatchName, SEEvent EventType, SolidEdgeDocumentEventHelper Helper)
 {
     if (_mDicOccurrenceEvent.TryGetValue(Key, out var Lists))
     {
         Lists.Add(new List <object>()
         {
             MatchName, EventType, Helper
         });
     }
     else
     {
         _mDicOccurrenceEvent.Add(Key, new List <List <object> >()
         {
             new List <object>()
             {
                 MatchName, EventType, Helper
             }
         });
     }
 }
Ejemplo n.º 28
0
        public ConnectLobby()
        {
            DrawableServerIP = new DrawableString(new DrawingOptions()
            {
                Position = new Vector2(117, 200)
            }, CreateIPString(""));
            DrawableStatus = new DrawableString(new DrawingOptions()
            {
                Position = new Vector2(117, 300)
            });

            Strings.Add(DrawableServerIP);
            Strings.Add(DrawableStatus);

            ConnectOptions                   = new ConnectOptions();
            ConnectOptions.Visible           = false;
            ConnectOptions.TopLeft           = new Vector2(100, 100);
            ConnectOptions.SelectionChanged += AdjustTextToSelection;

            Lists.Add(ConnectOptions);
        }
Ejemplo n.º 29
0
        private async Task LoadLists()
        {
            IsBusy = true;
            try
            {
                Lists.Clear();
                var items = await groceryService.GetAllProductsListAsync();

                foreach (var item in items)
                {
                    Lists.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
Ejemplo n.º 30
0
 private void breakDownSubEntities(Type type, Action <string> log, bool throwOnCircularReference)
 {
     if (Spec.fields == null)
     {
         return;
     }
     foreach (var subEntitySpec in Spec.fields)
     {
         subEntitySpec.nosave |= NoSave; // propagate NoSave all the way down until we reach turtles
         foreach (var subEntity in expansionOverStar(log, this, type, subEntitySpec, new HashSet <Type>(), throwOnCircularReference))
         {
             if (subEntity is EntityClass)
             {
                 Lists.Add((EntityClass)subEntity);
             }
             else
             {
                 Fields.Add(subEntity);
             }
         }
     }
 }