private static UICardDesk NewDatabaseDesk(Database database, out UICard dataBaseCard) { UICardPile[] cardPiles = new UICardPile[] { new UICardPile(), new UICardPile() }; dataBaseCard = UICard.NewCard(typeof(Database), false, false, database); cardPiles[0].PileCard(dataBaseCard); return(new UICardDesk(cardPiles)); }
private static UICardDesk NewCalculatorDesk(out UICard inputCard, out UICard outputCard) { UICardPile[] cardPiles = new UICardPile[] { new UICardPile(), new UICardPile() }; inputCard = UICard.NewCard(typeof(CalculatorInput), false, false); cardPiles[0].PileCard(inputCard); outputCard = UICard.NewCard(typeof(CalculatorOutput), true, false); cardPiles[1].PileCard(outputCard); return(new UICardDesk(cardPiles)); }
private UICard ResetTopCard() { if (topBuilder == null) { return(null); } Type dataType = currentTopDataType != null?Type.GetType(currentTopDataType) : null; if (dataType != null) { if (topBuilder.CurrentCard == null || dataType != topBuilder.CurrentCard.GetDataType()) { topBuilder.BuildCard(UICard.NewCard(dataType, false, true)); } } else if (topBuilder.CurrentCard != null) { topBuilder.ClearCard(); } return(topBuilder.CurrentCard); }
private UICard ResetBottomCard() { if (bottomBuilder == null) { return(null); } Type dataType = currentBottomDataType != null?Type.GetType(currentBottomDataType) : null; if (dataType != null) { if (bottomBuilder.CurrentCard == null || dataType != bottomBuilder.CurrentCard.GetDataType()) { bottomBuilder.BuildCard(UICard.NewCard(dataType, false, false)); } } else if (bottomBuilder.CurrentCard != null) { bottomBuilder.ClearCard(); } return(bottomBuilder.CurrentCard); }