コード例 #1
0
        // populate the fields
        void populateControls()
        {
            // set datasources
            cbxPaddingHoriz.DataSource = Enum.GetNames(typeof(OutputConfiguration.PaddingRemoval));
            cbxPaddingVert.DataSource  = Enum.GetNames(typeof(OutputConfiguration.PaddingRemoval));
            cbxCommentStyle.DataSource = Enum.GetNames(typeof(OutputConfiguration.CommentStyle));
            cbxBitLayout.DataSource    = Enum.GetNames(typeof(OutputConfiguration.BitLayout));
            cbxByteFormat.DataSource   = Enum.GetNames(typeof(OutputConfiguration.ByteFormat));
            cbxRotation.DataSource     = OutputConfiguration.Rotation.GetNames();

            // display string arrays
            cbxCharWidthFormat.Items.AddRange(OutputConfiguration.DescriptorFormatDisplayString);
            cbxCharHeightFormat.Items.AddRange(OutputConfiguration.DescriptorFormatDisplayString);
            cbxFontHeightFormat.Items.AddRange(OutputConfiguration.DescriptorFormatDisplayString);
            cbxImgWidthFormat.Items.AddRange(OutputConfiguration.DescriptorFormatDisplayString);
            cbxImgHeightFormat.Items.AddRange(OutputConfiguration.DescriptorFormatDisplayString);

            cbxCharacterEncoding.Items.AddRange(CodePageInfo.GetEncoderNameList());

            // add leading
            cbxByteLeadingChar.Items.Add(OutputConfiguration.ByteLeadingStringBinary);
            cbxByteLeadingChar.Items.Add(OutputConfiguration.ByteLeadingStringHex);

            txtBmpVisualizerChar.Items.AddRange(OutputConfiguration.CommentVisualizerChar);

            // re-populate dropdown
            m_outputConfigurationManager.comboBoxPopulate(cbxOutputConfigurations);
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: dimitarm1/the-dot-factory
        private void Form1_Load(object sender, EventArgs e)
        {
            // use double buffering
            DoubleBuffered = true;

            // set version
            Text = String.Format("The Dot Factory v.{0}", Application.ProductVersion);

            // set input box
            txtInputText.Text = Properties.Settings.Default.InputText;

            // load font
            fontDlgInputFont.Font = Properties.Settings.Default.InputFont;

            // load configurations from file
            m_outputConfigurationManager.loadFromFile("OutputConfigs.xml");

            // update the dropdown
            m_outputConfigurationManager.comboBoxPopulate(cbxOutputConfiguration);

            // get saved output config index
            int lastUsedOutputConfigurationIndex = Properties.Settings.Default.OutputConfigIndex;

            // load recently used preset
            if (lastUsedOutputConfigurationIndex >= 0 &&
                lastUsedOutputConfigurationIndex < cbxOutputConfiguration.Items.Count)
            {
                // last used
                cbxOutputConfiguration.SelectedIndex = lastUsedOutputConfigurationIndex;

                // load selected configuration
                m_outputConfig = m_outputConfigurationManager.configurationGetAtIndex(lastUsedOutputConfigurationIndex);
            }
            else
            {
                // there's no saved configuration. get the working copy (default)
                m_outputConfig = m_outputConfigurationManager.workingOutputConfiguration;
            }

            // set checkbox stuff
            populateTextInsertCheckbox();

            populateComboBoxInputImageCodepage();

            // apply font to all appropriate places
            updateSelectedFont(Properties.Settings.Default.InputFont);
        }