Example #1
0
 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();
 }
Example #2
0
 public Settings(IGUIFactory factory)
 {
     button = factory.CreateButton();
     button.Command();
     appearance = factory.ApplyBackground();
     appearance.SetBackground();
 }
Example #3
0
        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);
        }
Example #4
0
        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());
        }
Example #6
0
        private void ClientMethod(IGUIFactory winFactory)
        {
            var Button   = winFactory.CrearBoton();
            var Checkbox = winFactory.CrearCheckbox();

            Console.WriteLine(Checkbox.UsefulFunctionCheckbox());
            Console.WriteLine(Checkbox.AnotherUsefulFunctionCheckbox(Button));
        }
Example #7
0
        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);
        }
Example #8
0
        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);
        }
Example #9
0
        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());
        }
Example #10
0
        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();
        }
Example #11
0
        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);
        }
Example #12
0
        public Client(string operationSystem)
        {
            _operationSystem = operationSystem;

            if (_operationSystem == "Windows")
            {
                GuiFactory = new WinFactory();
            }
            else if (_operationSystem == "MacOs")
            {
                GuiFactory = new MacFactory();
            }
        }
Example #13
0
        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!");
            }
        }
Example #15
0
        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);
        }
Example #17
0
        // 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();
 }
Example #19
0
 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;
 }
Example #22
0
 public Application(IGUIFactory factory)
 {
     _factory = factory;
 }
 public Gui(IGUIFactory factory) =>
Example #24
0
 public static void App(IGUIFactory factory)
 {
     IButton btn = factory.CreateButton();
 }
Example #25
0
 public Application(IGUIFactory factory)
 {
     var button = factory.CreateButton();
     button.Paint();
 }
Example #26
0
        public Aplicacao(IGUIFactory factory)
        {
            IBotao botao = factory.CriarBotao();

            botao.Pintar();
        }
Example #27
0
 // 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();
 }