static Services()
 {
     palette = new Palette();
     pictureBoxImageHolder  = new PictureBoxImageHolder();
     settingsManager        = new SettingsManager(new XmlObjectSerializer(), new FileBlobStorage());
     appSettings            = settingsManager.Load();
     imageSettingsProvider  = appSettings;
     imageDirectoryProvider = appSettings;
 }
Ejemplo n.º 2
0
        public MainForm(IUiAction[] actions, PictureBoxImageHolder pictureBox, ImageSettings imageSettings)
        {
            ClientSize = new Size(imageSettings.Width, imageSettings.Height);

            var mainMenu = new MenuStrip();

            mainMenu.Items.AddRange(actions.ToMenuItems());
            Controls.Add(mainMenu);

            pictureBox.Dock = DockStyle.Fill;
            Controls.Add(pictureBox);
        }
Ejemplo n.º 3
0
        public MainForm(IUiAction[] actions, PictureBoxImageHolder pictureBox, Palette palette)
        {
            var imageSettings = CreateSettingsManager().Load().ImageSettings;

            ClientSize = new Size(imageSettings.Width, imageSettings.Height);

            var mainMenu = new MenuStrip();

            mainMenu.Items.AddRange(actions.ToMenuItems());
            Controls.Add(mainMenu);

            pictureBox.RecreateImage(imageSettings);
            pictureBox.Dock = DockStyle.Fill;
            Controls.Add(pictureBox);
        }
Ejemplo n.º 4
0
        public MainForm(IUiAction[] actions, PictureBoxImageHolder pictureBox, Palette palette, AppSettings appSettings)
        {
            var imageSettings = appSettings.ImageSettings;

            ClientSize = new Size(imageSettings.Width, imageSettings.Height);

            var mainMenu = new MenuStrip();

            mainMenu.Items.AddRange(actions.OrderBy(x => x.Order).ToArray().ToMenuItems());
            Controls.Add(mainMenu);

            pictureBox.RecreateImage(imageSettings);
            pictureBox.Dock = DockStyle.Fill;
            Controls.Add(pictureBox);
        }
Ejemplo n.º 5
0
        public MainForm(IUiAction[] actions, PictureBoxImageHolder pictureBox)
        {
            var imageSettings = CreateSettingsManager().Load().ImageSettings;

            ClientSize = new Size(imageSettings.Width, imageSettings.Height);

            var mainMenu = new MenuStrip();

            mainMenu.Items.AddRange(actions.ToMenuItems());
            Controls.Add(mainMenu);

            pictureBox.RecreateImage(imageSettings);
            pictureBox.Dock = DockStyle.Fill;
            Controls.Add(pictureBox);

            DependencyInjector.Inject <IImageHolder>(actions, pictureBox);
            DependencyInjector.Inject <IImageDirectoryProvider>(actions, CreateSettingsManager().Load());
            DependencyInjector.Inject <IImageSettingsProvider>(actions, CreateSettingsManager().Load());
            DependencyInjector.Inject(actions, new Palette());
        }
 public MainForm(IUiAction[] actions, PictureBoxImageHolder pictureBox)
 {
     SetupMainForm(actions, pictureBox);
 }