public void Init(MainSetsObservable <SU, CO, RU, SE, T> thisMod, string tagUsed) { _tagUsed = tagUsed; _thisStack = new StackLayout(); _thisStack.Orientation = StackOrientation.Horizontal; IndividualRummySetXF <SU, CO, RU, GC, GW, SE, T> thisTemp; Grid firstGrid = new Grid(); ScrollView thisScroll = new ScrollView(); thisScroll.Orientation = ScrollOrientation.Both; if (thisMod.HasFrame == true) { Text = thisMod.Text; var thisRect = ThisFrame.GetControlArea(); thisScroll.Margin = new Thickness((double)thisRect.Left + (float)3, (double)thisRect.Top + (float)3, 3, 5); // try this way. firstGrid.Children.Add(ThisDraw); firstGrid.Children.Add(thisScroll); } else { firstGrid.Children.Add(thisScroll);// this alone. } _setList = thisMod.SetList; foreach (var thisSet in thisMod.SetList) { thisTemp = new IndividualRummySetXF <SU, CO, RU, GC, GW, SE, T>(); thisTemp.Divider = Divider; thisTemp.Additionals = Additionals; thisTemp.LoadList(thisSet, tagUsed); _thisStack.Children.Add(thisTemp); } _setList.CollectionChanged += SetList_CollectionChanged; thisScroll.Content = _thisStack; Content = firstGrid; }
public void Init(PublicViewModel mod) { _thisMod = mod; _thisStack = new StackLayout(); var tempCard = new DutchBlitzCardInformation(); var thisP = Resolve <IProportionImage>(); HeightRequest = tempCard.DefaultSize.Height * thisP.Proportion; _thisStack.Orientation = StackOrientation.Horizontal; // start out horizontally _thisStack.HorizontalOptions = LayoutOptions.Start; _thisStack.VerticalOptions = LayoutOptions.Start; Grid grid = new Grid(); _drawControl = new SKCanvasView(); _drawControl.EnableTouchEvents = true; _drawControl.Touch += TouchEvent; _pileList = _thisMod.PileList; // i think its that simple. _pileList.CollectionChanged += PileList_CollectionChanged; foreach (var thisPile in _pileList) { IndividualPileXF thisCon = new IndividualPileXF(); thisCon.ThisPile = thisPile; thisCon.MainMod = _thisMod; thisCon.Init(); // i think i needed this as well _thisStack.Children.Add(thisCon); } grid.Children.Add(_drawControl); grid.Children.Add(_thisStack); Content = grid; }
public void LoadLists(IListViewPicker mod) { _thisMod = mod; _textList = _thisMod.TextList; _textList.CollectionChanged += TextList_CollectionChanged; if (TotalColumns == 0) { _thisStack = new StackLayout(); _thisStack.Orientation = Orientation; } else { _thisGrid = new Grid(); AddAutoRows(_thisGrid, 1); //at least one row obviously. AddAutoColumns(_thisGrid, TotalColumns); } Margin = new Thickness(3, 3, 3, 3); PopulateList(); if (TotalColumns == 0) { Content = _thisStack; } else { Content = _thisGrid; } }
public void Init(TeamCP mod, MillebournesMainGameClass mainGame, CommandContainer commandContainer) { _safetyMod = mod; _commandContainer = commandContainer; _safetyList = _safetyMod.SafetyList; _safetyList.CollectionChanged += SafetyList_CollectionChanged; StackLayout thisStack = new StackLayout(); thisStack.Margin = new Thickness(3, 0, 3, 0); _safetyStack = new StackLayout(); _safetyStack.Spacing = 0; StackLayout tempStack = new StackLayout(); tempStack.Orientation = StackOrientation.Horizontal; var thisBut = GetButton("Safety", nameof(TeamCP.SafetyClickAsync), nameof(TeamCP.SafetyEnabled), mainGame); tempStack.Children.Add(thisBut); thisStack.Children.Add(_safetyStack); thisStack.Children.Add(tempStack); _safetyMod.SafetyList.ForEach(thisSafe => { AddLabel(thisSafe); }); Content = thisStack; }
public void Init(A8RoundRummyGameContainer gameContainer) { _roundList = gameContainer.SaveRoot !.RoundList; _roundList.CollectionChanged += RoundList_CollectionChanged; _thisStack = new StackLayout(); PopulateList(); Content = _thisStack; }
public void Init(ThreeLetterFunVMData model) { _tempMod = model.TileBoard1; _tileList = _tempMod !.HandList; _tileList.CollectionChanged += TileList_CollectionChanged; _thisStack = new StackLayout(); _thisStack.Orientation = StackOrientation.Horizontal; Content = _thisStack; PopulateControls(); }
public void LoadShips(CustomBasicList <ShipInfoCP> thisList, BattleshipMainViewModel model) { _thisStack = new StackLayout(); foreach (var thisShip in thisList) { var thisControl = new ShipInfoXF(); thisControl.CreateShip(thisShip, model); _thisStack.Children.Add(thisControl); } Content = _thisStack; }
public void LoadDiceViewModel(RummyDiceMainGameClass mainGame) { _thisMod = mainGame.MainBoard1; _board = mainGame.MainBoard1; Margin = new Thickness(3, 3, 3, 3); BindingContext = _thisMod; _diceList = mainGame.SaveRoot !.DiceList; _diceList.CollectionChanged += DiceList_CollectionChanged; _thisStack = new StackLayout(); _thisStack.Orientation = StackOrientation.Horizontal; // will always be horizontal for this one. PopulateList(); Content = _thisStack; }
public void LoadControls(FluxxGameContainer gameContainer) { Text = "Rule Information"; _ruleList = gameContainer.SaveRoot !.RuleList; _ruleList.CollectionChanged += RuleListChange; _stack = new StackLayout(); Grid grid = new Grid(); WidthRequest = 200; SetUpMarginsOnParentControl(_stack); //i think. grid.Children.Add(ThisDraw); grid.Children.Add(_stack); Content = grid; LoadRules(); }
public void LoadDiceViewModel(DiceCup <D> cup) { _thisCup = cup; BindingContext = _thisCup; _diceList = _thisCup.DiceList; _diceList.CollectionChanged += DiceList_CollectionChanged; //i think SetBinding(IsEnabledProperty, new Binding(nameof(DiceCup <D> .IsEnabled))); SetBinding(CanShowDiceProperty, new Binding(nameof(DiceCup <D> .CanShowDice))); SetBinding(ViewModelVisibleProperty, new Binding(nameof(DiceCup <D> .Visible))); _thisStack = new StackLayout(); _thisStack.Spacing = 0; _thisStack.Orientation = StackOrientation.Horizontal; // will always be horizontal for this one. PopulateList(); Content = _thisStack; }
public void LoadList(RummyDiceHandVM thisMod, RummyDiceMainGameClass mainGame) { _thisMod = thisMod; _mainGame = mainGame; BindingContext = thisMod; HorizontalOptions = LayoutOptions.FillAndExpand; //hopefully this works too. _handList = thisMod.HandList; _handList.CollectionChanged += HandList_CollectionChanged; Text = $"Temp Set {thisMod.Index}"; SetBinding(IsEnabledProperty, new Binding(nameof(RummyDiceHandVM.IsEnabled))); RummyDiceInfo firstDice = new RummyDiceInfo(); if (firstDice.HeightWidth == 0) { throw new BasicBlankException("You must specify the height/width of the dice"); } IProportionImage thisI = new CustomProportionXF(); SKSize firstSize = new SKSize(firstDice.HeightWidth, firstDice.HeightWidth); var sizeUsed = firstSize.GetSizeUsed(thisI.Proportion); Margin = new Thickness(3, 3, 3, 3); _thisStack = new StackLayout(); _thisStack.Orientation = StackOrientation.Horizontal; _thisStack.Spacing = 0; Button thisBut = GetSmallerButton("Place Tiles", ""); thisBut.Command = thisMod.BoardCommand; //i think this way this time. StackLayout finalStack = new StackLayout(); finalStack.Orientation = StackOrientation.Horizontal; finalStack.Children.Add(thisBut); finalStack.Spacing = 2; finalStack.Children.Add(_thisStack); thisBut.HorizontalOptions = LayoutOptions.Start; thisBut.VerticalOptions = LayoutOptions.Start; _thisStack.HorizontalOptions = LayoutOptions.FillAndExpand; thisBut.FontSize *= .7f; _thisGrid = new Grid(); _thisGrid.Children.Add(ThisDraw); _thisGrid.Children.Add(finalStack); var thisRect = ThisFrame.GetControlArea(); thisBut.Margin = new Thickness(thisRect.Left + 3, thisRect.Top + 10, 3, 3); _thisStack.Margin = new Thickness(thisRect.Left + 3, thisRect.Top + 10, 3, 3); PopulateControls(); //just in case there is something to start with. Content = _thisGrid; }
protected override void UpdateProperties(StackLayout?oldStack, StackLayout newStack, WPFStackLayout nativeStack) { nativeStack.CanVerticallyScroll = true; nativeStack.Orientation = newStack.Orientation switch { Orientation.Horizontal => WPFOrientation.Horizontal, Orientation.Vertical => WPFOrientation.Vertical, _ => throw new InvalidOperationException() }; nativeStack.Children.Clear(); foreach (var child in newStack.Children) { nativeStack.Children.Add(_registry.Render(child)); } } }
public void Init(XactikaVMData thisMod, IGamePackageResolver resolver) { SKSize firstSize = new SKSize(60, 138); IProportionImage thisP = resolver.Resolve <IProportionImage>(""); _sizeUsed = firstSize.GetSizeUsed(thisP.Proportion); _tempMod = thisMod.ShapeChoose1; _shapeList = _tempMod !.PieceList; Margin = new Thickness(10, 10, 10, 10); BindingContext = _tempMod; // i think var thisBind = new Binding(nameof(ChooseShapeObservable.Visible)); SetBinding(IsVisibleProperty, thisBind); // i think _thisStack = new StackLayout(); _thisStack.Orientation = StackOrientation.Horizontal; // for this time, must be horizontal. _shapeList.CollectionChanged += ShapeList_CollectionChanged; Content = _thisStack; PopulateList(); }
public void LoadList(SE thisSet, string tagUsed) { ScrollView thisScroll = new ScrollView(); thisScroll.Orientation = ScrollOrientation.Vertical; _tagUsed = tagUsed; _thisMod = thisSet; _thisStack = new StackLayout(); _objectList = thisSet.HandList; Grid grid = new Grid(); grid.Children.Add(_thisStack); _drawControl = new SKCanvasView(); grid.Children.Add(_drawControl); _drawControl.EnableTouchEvents = true; _drawControl.Touch += DrawControlTouch; _objectList.CollectionChanged += ObjectList_CollectionChanged; thisScroll.Content = grid; Content = thisScroll; PopulateList(); }
public void Init(SolitairePilesCP thisMod) { _thisStack = new StackLayout(); SolitaireCard card = new SolitaireCard(); DeckOfCardsXF <SolitaireCard> temps = new DeckOfCardsXF <SolitaireCard>(); temps.SendSize(ts.TagUsed, card); var size = temps.Measure(double.PositiveInfinity, double.PositiveInfinity); if (size.Request.Height == 0 || size.Request.Width == 0) { throw new BasicBlankException("Was unable to get the width or height request. Rethink"); } else { SolitaireOverlapLayoutXF.MinWidth = size.Request.Width + 9; } _thisStack.Orientation = StackOrientation.Horizontal; _thisStack.Spacing = 0; ScrollView thisScroll = new ScrollView(); thisScroll.Orientation = ScrollOrientation.Horizontal; _thisMod = thisMod; if (thisMod.PileList.Count == 0) { throw new BasicBlankException("Must have at least one pile. Otherwise, not worth even using this"); } thisMod.PileList.ForEach(thisPile => { IndividualSolitairePileXF thisG = new IndividualSolitairePileXF(); thisG.MainMod = thisMod; thisG.ThisPile = thisPile; thisG.Margin = new Thickness(0, 0, 0, 0); //try this _thisStack.Children.Add(thisG); thisG.Init(_needsPopulating); }); _needsPopulating = false; thisScroll.Content = _thisStack; Content = thisScroll; }
public void LoadBoard(CustomBasicList <SingleDiceInfo> thisList) { if (thisList.Count != 10) { throw new BasicBlankException("Must have 10 bowling dice to represent the maximum score is 10"); } _thisStack = new StackLayout(); _thisStack.Orientation = StackOrientation.Horizontal; _thisStack.Margin = new Thickness(5, 5, 5, 5); foreach (var thisInfo in thisList) { SingleDiceXF thisGraphics = new SingleDiceXF(); thisGraphics.BindingContext = thisInfo; thisGraphics.WidthRequest = 40; thisGraphics.HeightRequest = 40; thisGraphics.SetBinding(SingleDiceXF.DidHitProperty, nameof(SingleDiceInfo.DidHit)); thisGraphics.Margin = new Thickness(0, 0, 10, 0); _thisStack.Children.Add(thisGraphics); thisGraphics.Init(); } Content = _thisStack; }
public void Init(Guess thisGuess) { _thisStack = new StackLayout(); _thisStack.Orientation = StackOrientation.Horizontal; _thisStack.Spacing = 0; // at first, act like its nothing. int x; for (x = 1; x <= 4; x++) { CirclePieceXF <EnumColorPossibilities> thisCon = new CirclePieceXF <EnumColorPossibilities>(); thisCon.NeedsWhiteBorders = true; thisCon.HeightRequest = GuessWidthHeight; thisCon.WidthRequest = GuessWidthHeight; thisCon.Init(); _thisStack.Children.Add(thisCon); } Content = _thisStack; SetBinding(HowManyCompletelyCorrectProperty, new Binding(nameof(Guess.HowManyBlacks))); SetBinding(HowManySemiCorrectProperty, new Binding(nameof(Guess.HowManyAquas))); BindingContext = thisGuess; }
public void Init(RackoMainViewModel viewModel, RackoVMData model, RackoGameContainer gameContainer) { gameContainer.SingleInfo = gameContainer !.PlayerList !.GetSelf(); _cardList = gameContainer.SingleInfo.MainHandList; _thisCommand = viewModel.GetBasicGameCommand(nameof(RackoMainViewModel.PlayOnPileAsync)); Grid mainGrid = new Grid(); _thisStack = new StackLayout(); Text = "Your Card List"; var thisRect = ThisFrame.GetControlArea(); _thisStack.Margin = new Thickness(thisRect.Left + 3, thisRect.Top + 10, 3, 3); if (gameContainer.SingleInfo.MainHandList.Count != 10) { throw new BasicBlankException("Must have 10 cards before i can init. Rethink now."); } _thisCommand !.CanExecuteChanged += ThisCommand_CanExecuteChanged; _cardList.CollectionChanged += CardList_CollectionChanged; PopulateControls(gameContainer); mainGrid.Children.Add(ThisDraw); mainGrid.Children.Add(_thisStack); Content = mainGrid; }
public void Init(EagleWingsSolitaireMainViewModel thisMod) { var thisDeck = new BaseDeckXF <SolitaireCard, ts, DeckOfCardsXF <SolitaireCard> >(); thisDeck.Init(thisMod.Heel1 !, ts.TagUsed); WastePiles tempWaste = (WastePiles)thisMod.WastePiles1 !; if (tempWaste.Piles.PileList.Count != 8) { throw new BasicBlankException("Must have 8 piles in order to initialize the plane ui"); } var firstList = tempWaste.Piles.PileList.Take(4).ToCustomBasicList(); _thisStack = new StackLayout(); _thisStack.Orientation = StackOrientation.Horizontal; LoadPiles(firstList, tempWaste); _thisStack.Children.Add(thisDeck); var lastList = tempWaste.Piles.PileList.Skip(4).ToCustomBasicList(); LoadPiles(lastList, tempWaste); Content = _thisStack; _needsPopulating = false; }
public void Init(PublicPilesViewModel mod) { _thisMod = mod; _parentGrid = new Grid(); _thisStack = new StackLayout(); var tempCard = new FlinchCardInformation(); var thisP = Resolve <IProportionImage>(); _sizeUsed = tempCard.DefaultSize.GetSizeUsed(thisP.Proportion); _thisStack.Orientation = StackOrientation.Horizontal; // start out horizontally _pileList = _thisMod.PileList; // i think its that simple. _pileList.CollectionChanged += PileList_CollectionChanged; HeightRequest = _sizeUsed.Height; foreach (var thisPile in _pileList) { IndividualPileXF thisCon = new IndividualPileXF(); thisCon.ThisPile = thisPile; thisCon.MainMod = _thisMod; thisCon.Init(); // i think i needed this as well _thisStack.Children.Add(thisCon); } _parentGrid.Children.Add(_thisStack); Content = _parentGrid; }
public IVirtualThread[] GetVirtualThreads( IGlobalExpressionEvaluator e) { // Get the total number of tasks running int taskCount = (int)e.EvaluateIntegralExpression("uxCurrentNumberOfTasks"); // Get the number of different priorities (i.e. configMAX_PRIORITIES) -- // there is a ready task list for each possible priority int priorityCount = (int)e.EvaluateIntegralExpression("sizeof(pxReadyTasksLists)/sizeof(pxReadyTasksLists[0])"); List <IVirtualThread> threads = new List <IVirtualThread>(); // Get a pointer to the current TCB -- it's used to compare to the TCB of // each list found below, and a match means it's the currently running task UInt64?pxCurrentTCB = e.EvaluateIntegralExpression("pxCurrentTCB"); int currentTask = 0; // If the CPU type hasn't been found yet, do it -- it's necessary to find // out the stack layout later on if (!_StackLayout.HasValue) { int disassemblyLines = e.GDBSession.ExecuteCommand("disassemble PendSV_Handler").AdditionalOutput?.Count(s => rgDisassemblyLine.IsMatch(s)) ?? 0; if (disassemblyLines == 0) { disassemblyLines = e.GDBSession.ExecuteCommand("disassemble xPortPendSVHandler").AdditionalOutput?.Count(s => rgDisassemblyLine.IsMatch(s)) ?? 0; } if (disassemblyLines >= 21 && disassemblyLines <= 22) { _StackLayout = StackLayout.WithoutFPU; } else if (disassemblyLines >= 30 && disassemblyLines <= 33) { _StackLayout = StackLayout.WithOptionalFPU; } else if (e.EvaluateIntegralExpression("sizeof(void *)") == 8) { _StackLayout = StackLayout.CortexA53; } else { var cpu = GetCPUType(e); _StackLayout = (cpu == CPUTypes.CPU_ARM_CORTEX_M4) ? StackLayout.WithOptionalFPU : StackLayout.WithoutFPU; } } // Find tasks in ready lists -- one for each possible priority in FreeRTOS for (int i = 0; i < priorityCount; i++) { // Add all tasks found in this list threads.AddRange(GetThreadsFromList(e, "pxReadyTasksLists[" + i + "]", pxCurrentTCB, ref currentTask)); // If all tasks are accounted for, return early so as not to waste time // querying for extra tasks if (currentTask == taskCount) { return(threads.ToArray()); } } // Find tasks in delayed task lists for (int i = 1; i <= 2; i++) { // Add all tasks found in this list threads.AddRange(GetThreadsFromList(e, "xDelayedTaskList" + i, pxCurrentTCB, ref currentTask)); // If all tasks are accounted for, return early so as not to waste time // querying for extra tasks if (currentTask == taskCount) { return(threads.ToArray()); } } // Find tasks in suspended task list threads.AddRange(GetThreadsFromList(e, "xSuspendedTaskList", pxCurrentTCB, ref currentTask)); return(threads.ToArray()); }
public void LoadList(HandObservable <CA> thisMod, string tagUsed) { CA firstCard; _tagUsed = tagUsed; BindingContext = thisMod; SetBinding(TextProperty, new Binding(nameof(HandObservable <CA> .Text))); SetBinding(IsEnabledProperty, new Binding(nameof(HandObservable <CA> .IsEnabled))); _thisMod = thisMod; if (_alreadyLoaded == true) { throw new BasicBlankException("Needs some rethinking because i intended to load once"); } if (_thisMod.HandList.Count == 0) { firstCard = new CA(); } else { firstCard = _thisMod.HandList.First(); } if (firstCard.DefaultSize.Height == 0 || firstCard.DefaultSize.Width == 0) { throw new BasicBlankException("The width and height must be greater than 0 when initializging hand wpf"); } IGamePackageResolver thisR = (IGamePackageResolver)cons !; IProportionImage thisI = thisR.Resolve <IProportionImage>(tagUsed); _sizeUsed = firstCard.DefaultSize.GetSizeUsed(thisI.Proportion); ObjectList = _thisMod.HandList; ObjectList.CollectionChanged += ObjectList_CollectionChanged; ThisScroll = new ScrollView(); if (HasAngles == false) { _thisStack = new GameOverlapLayout <CA, GC>(_sizeUsed); _thisStack.Spacing = 0; } else { _otherStack = new StackLayout(); _otherStack.Spacing = 0; } SetBinding(MaximumCardsProperty, new Binding(nameof(HandObservable <CA> .Maximum))); PositionMainControls(); PopulateList(); SetVisibleConverter(); _thisGrid.Children.Add(ThisDraw); ThisScroll.HorizontalScrollBarVisibility = ScrollBarVisibility.Default; ThisScroll.VerticalScrollBarVisibility = ScrollBarVisibility.Default; //try this too. if (HasAngles == false) { ThisScroll.Content = _thisStack; } else { ThisScroll.Content = _otherStack; } var thisRect = ThisFrame.GetControlArea(); if (HasAngles == false) { ThisScroll.Margin = new Thickness(thisRect.Left - 1, thisRect.Top - 1, 0, 3); // try this way. } else { ThisScroll.Margin = new Thickness(thisRect.Left - 1, thisRect.Top - 1, 3, 3); } _thisGrid.Children.Add(ThisScroll); RecalulateFrames(); _drawControl = new SKCanvasView(); _drawControl.EnableTouchEvents = true; _drawControl.Touch += DrawControlTouch; _thisGrid.Children.Add(_drawControl); Content = _thisGrid; _alreadyLoaded = true; }