public void Start(IGUIFactory factory) { //The objects and their operations are rely on the factory passed to application //Provide an interface for creating families of related or dependent objects without specifying their concrete classes var button = factory.CreateButton(); var border = factory.CreateBorder(); }
public Settings(IGUIFactory factory) { button = factory.CreateButton(); button.Command(); appearance = factory.ApplyBackground(); appearance.SetBackground(); }
private void CreateImageButton(int displayOrder, IGUIFactory factory) { ImageButton btn = factory.CreateImageButton(); btn.Location = new Point(60, 10 + 100 * displayOrder); btn.TileButton.Text = "Img Button"; panelDisplay.Controls.Add(btn); }
private void CreateLabel(int displayOrder, IGUIFactory factory) { CenteredLabel btn = factory.CreateLabel(); btn.Location = new Point(60, 10 + 100 * displayOrder); btn.Text = "Theme Label"; panelDisplay.Controls.Add(btn); }
public void ClientMethod(IGUIFactory factory) { var button = factory.CreateButton(); var checkBox = factory.CreateCheckBox(); Console.WriteLine(button.CreateButton()); Console.WriteLine(checkBox.CreateCheckBox()); }
private void ClientMethod(IGUIFactory winFactory) { var Button = winFactory.CrearBoton(); var Checkbox = winFactory.CrearCheckbox(); Console.WriteLine(Checkbox.UsefulFunctionCheckbox()); Console.WriteLine(Checkbox.AnotherUsefulFunctionCheckbox(Button)); }
private void CreateActionButton(int displayOrder, IGUIFactory factory) { ActionButton btn = factory.CreateButton(); btn.Location = new Point(60, 10 + 100 * displayOrder); btn.Text = "Theme Button"; panelDisplay.Controls.Add(btn); }
public IWindow CreateWindow(IGUIFactory guiFactoryfactory) { var window = guiFactoryfactory.Window(); var button = guiFactoryfactory.Button(); var label = guiFactoryfactory.Label(); window.AddChild(button); window.AddChild(label); return(window); }
public void ClientMethod(IGUIFactory factory) { var productA = factory.CreateButton(); var productB = factory.CreateCheckBox(); var productC = factory.CreateRadioButton(); Console.WriteLine(productA.UsefulFunctioButton()); Console.WriteLine(productB.UsefulFunctionCheckBox()); Console.WriteLine(productC.UsefulFunctionRadioButton()); }
public void ClientMethod(IGUIFactory factory) { var productA = factory.CreateButton(); var productB = factory.CreateCheckbox(); Console.WriteLine(productA.UsarButton()); Console.WriteLine(productB.UsarCheckBox()); Console.WriteLine(); Console.ReadLine(); }
private static void CreateWindowWithTwoButtonsAndProgressBar(IGUIFactory factory) { var button1 = factory.CreateButton(); var button2 = factory.CreateButton(); var progressBar = factory.CreateProgressBar(); button1.Paint(); button2.Paint(); progressBar.Paint(); progressBar.SetProgress(45); }
public Client(string operationSystem) { _operationSystem = operationSystem; if (_operationSystem == "Windows") { GuiFactory = new WinFactory(); } else if (_operationSystem == "MacOs") { GuiFactory = new MacFactory(); } }
public Client(IGUIFactory factory) { IComponent button = factory.CreateButton(); button.Paint(); IComponent list = factory.CreateList(); list.Paint(); IComponent table = factory.CreateTable(); table.Paint(); }
public App(OS os) { switch (os) { case OS.Windows: _guiFactory = new WinFactory(); break; case OS.Mac: _guiFactory = new MacFactory(); break; default: throw new Exception("The OS is not supported!"); } }
private void CreateSampleUI() { string theme = ((string)cmbBoxTheme.SelectedItem); if (!string.IsNullOrEmpty(theme)) { IGUIFactory factory = controlFactory.GetFactory(theme.ToLower()); if (factory != null) { CreateActionButton(0, factory); CreateLabel(1, factory); CreateImageButton(2, factory); } } }
public IGUIFactory GetFactory(string theme) { IGUIFactory factory = null; if (string.Compare(theme, GUIConstants.lightTheme) == 0) { factory = lightFactory; } else if (string.Compare(theme, GUIConstants.darkTheme) == 0) { factory = darkFactory; } else { } return(factory); }
// this method can be called with DefaultGUIFactory or SkinnedGUIFactory для получениия окна заданного вида. public string GetUserInput(IGUIFactory guiFactory) { // Create UI elements IWindow wndInput = guiFactory.CreateWindow(); IButton btnOk = guiFactory.CreateButton(); IButton btnCancel = guiFactory.CreateButton(); ITextBox tbInput = guiFactory.CreateTextBox(); //TODO: Setup the window and elements //wndInput.AddChild(btnOk); //wndInput.AddChild(btnCancel); //wndInput.AddChild(tbInput); // TODO: Show dialog // TODO: Get the result return string.Empty; //tbInput.GetText(); }
public AbstractPlatform(IGUIFactory gUIFactory) { _button = gUIFactory.CreateButton(); _checkBox = gUIFactory.CreateCheckBox(); }
public Application(IGUIFactory guiFactory) { button = guiFactory.CreateButton(); checkbox = guiFactory.CreateCheckbox(); }
public Application(IGUIFactory factory) { var button = factory.CreateButton(); button.Paint(); }
public Application(IGUIFactory factory) { this.factory = factory; }
public Application(IGUIFactory factory) { _factory = factory; }
public Gui(IGUIFactory factory) =>
public static void App(IGUIFactory factory) { IButton btn = factory.CreateButton(); }
public Aplicacao(IGUIFactory factory) { IBotao botao = factory.CriarBotao(); botao.Pintar(); }
// This is how the abstract factory would be used, but isn't related to the pattern public Application(IGUIFactory factory) { _button = factory.CreateButton(); }
public GuiControlFactory() { lightFactory = new LightThemeFactory(); darkFactory = new DarkThemeFactory(); }