Пример #1
0
 /// <summary>
 /// Constructor for the class
 /// </summary>
 public AddTemplateDialog(MainForm main)
     : base(main)
 {
     InitializeComponent();
     mainForm = main as MakeViewMainForm;
     InitSettings();
 }
        /// <summary>
        /// Dispose of any components
        /// </summary>
        public override void Dispose()
        {
            // trash container and any components
            this.container.Dispose();

            form = null;

            // base class will finish the job
            base.Dispose();
        }
Пример #3
0
        /// <summary>
        /// Constructor for the class
        /// </summary>
        public RenameTemplate(MainForm main, string copiedFolderName, string copiedExtension)
            : base(main)
        {
            InitializeComponent();
            mainForm = main as MakeViewMainForm;

            _copiedFolderName = copiedFolderName;
            _copiedExtension  = copiedExtension;

            InitSettings();
        }
        /// <summary>
        /// Attach the current project with module loading
        /// </summary>
        protected override void Load(IModuleManager moduleManager, ICommandLine commandLine)
        {
            base.Load(moduleManager, commandLine);

            try
            {
                if (form == null)
                {
                    form = new MakeViewMainForm(this);
                    container.Add(form);
                    form.Closed   += new EventHandler(MainForm_Closed);
                    form.Disposed += new EventHandler(MainForm_Disposed);
                    form.Show();
                    form.Activate();

                    // assure handle creation
                    System.IntPtr handle = form.Handle;

                    // read the command line
                    if (commandLine != null)
                    {
                        string titleArgument = commandLine.GetArgument("title");
                        if (titleArgument != null)
                        {
                            form.Text = titleArgument;
                        }
                    }
                    base.OnLoaded();
                }
                else
                {
                    if (!form.IsDisposed)
                    {
                        form.Show();
                        if (form.WindowState == FormWindowState.Minimized)
                        {
                            form.WindowState = FormWindowState.Normal;
                        }
                        form.Activate();
                    }
                }
            }
            finally
            {
            }
        }
Пример #5
0
        /// <summary>
        /// Constructor for the class
        /// </summary>
        public PageSetupDialog(MainForm main) : base(main)
        {
            InitializeComponent();
            mainForm = main as MakeViewMainForm;

            _sizes = new System.Collections.Generic.Dictionary <String, Size>();
            string displayLabel;
            Size   size;

            /// INCHES
            FormatSizeKeyValue("Letter (default)", PaperSizeUnit.Inches, 8.5, 11, out displayLabel, out size);
            _sizes.Add(displayLabel, size);
            FormatSizeKeyValue("Legal", PaperSizeUnit.Inches, 8.5, 14, out displayLabel, out size);
            _sizes.Add(displayLabel, size);
            FormatSizeKeyValue("Executive", PaperSizeUnit.Inches, 7.25, 10.5, out displayLabel, out size);
            _sizes.Add(displayLabel, size);

            /// MILLIMETERS
            FormatSizeKeyValue("A0", PaperSizeUnit.Millimeters, 841, 1189, out displayLabel, out size);
            _sizes.Add(displayLabel, size);
            FormatSizeKeyValue("A1", PaperSizeUnit.Millimeters, 594, 841, out displayLabel, out size);
            _sizes.Add(displayLabel, size);
            FormatSizeKeyValue("A2", PaperSizeUnit.Millimeters, 420, 594, out displayLabel, out size);
            _sizes.Add(displayLabel, size);
            FormatSizeKeyValue("A3", PaperSizeUnit.Millimeters, 297, 420, out displayLabel, out size);
            _sizes.Add(displayLabel, size);
            FormatSizeKeyValue("A4", PaperSizeUnit.Millimeters, 210, 297, out displayLabel, out size);
            _sizes.Add(displayLabel, size);
            FormatSizeKeyValue("A5", PaperSizeUnit.Millimeters, 148, 210, out displayLabel, out size);
            _sizes.Add(displayLabel, size);
            FormatSizeKeyValue("A6", PaperSizeUnit.Millimeters, 105, 148, out displayLabel, out size);
            _sizes.Add(displayLabel, size);

            /// ANDROID
            FormatSizeKeyValue("Mobile Interview", PaperSizeUnit.Pixels, 549, 780, out displayLabel, out size);
            _sizes.Add(displayLabel, size);

            displayLabel = "Custom Size";
            _sizes.Add(displayLabel, new Size(780, 1016));
            _useAsDefaultPageSize = displayLabel;

            InitSettings();
        }
Пример #6
0
        /// <summary>
        /// Constructor for the class
        /// </summary>
        public BackgroundDialog(MainForm form)
            : base(form)
        {
            InitializeComponent();
            mainForm = form as MakeViewMainForm;
            InitSettings();
            cbImageLayout.SelectedIndexChanged += new EventHandler(cbImageLayout_SelectedIndexChanged);
            btnChangeColor.Click  += new System.EventHandler(OnChangeColor);
            panelColor.Click      += new EventHandler(OnChangeColor);
            btnChooseImage.Click  += new EventHandler(OnChangeImage);
            pictureBoxImage.Click += new EventHandler(OnChangeImage);
            backgroundTable        = mainForm.CurrentPage.GetMetadata().GetPageBackgroundData(mainForm.CurrentPage);

            if (backgroundTable.Rows.Count > 0)
            {
                layout = Convert.ToString(backgroundTable.Rows[0]["ImageLayout"]);

                if (backgroundTable.Rows[0]["Color"] != System.DBNull.Value)
                {
                    color = Color.FromArgb(Convert.ToInt32(backgroundTable.Rows[0]["Color"]));
                }
            }
        }