ToString() публичный Метод

オブジェクトの情報を文字列で出力します。
public ToString ( ) : string
Результат string
Пример #1
0
        /* ----------------------------------------------------------------- */
        ///
        /// SaveSetting
        /// 
        /// <summary>
        /// 各種 GUI コンポーネントの情報を UserSetting に反映します。
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        private void SaveSetting(UserSetting setting)
        {
            string path = this.OutputPathTextBox.Text;
            setting.OutputPath = (path.Length == 0 || Directory.Exists(path)) ? path : Path.GetDirectoryName(path);
            path = this.InputPathTextBox.Text;
            setting.InputPath = (path.Length == 0 || Directory.Exists(path)) ? path : Path.GetDirectoryName(path);
            setting.UserProgram = this.UserProgramTextBox.Text;

            // コンボボックスのインデックス関連
            setting.FileType = Translator.IndexToFileType(this.FileTypeCombBox.SelectedIndex);
            setting.PDFVersion = Translator.IndexToPDFVersion(this.PDFVersionComboBox.SelectedIndex);
            setting.Resolution = Translator.IndexToResolution(this.ResolutionComboBox.SelectedIndex);
            setting.ExistedFile = Translator.IndexToExistedFile(this.ExistedFileComboBox.SelectedIndex);
            setting.PostProcess = Translator.IndexToPostProcess(_postproc.SelectedIndex);
            setting.DownSampling = Translator.IndexToDownSampling(this.DownSamplingComboBox.SelectedIndex);

            // チェックボックスのフラグ関連
            setting.PageRotation = this.PageLotationCheckBox.Checked;
            setting.EmbedFont = this.EmbedFontCheckBox.Checked;
            setting.Grayscale = this.GrayscaleCheckBox.Checked;
            setting.ImageFilter = this.ImageFilterCheckBox.Checked ? Parameter.ImageFilters.DCTEncode : Parameter.ImageFilters.FlateEncode;
            setting.WebOptimize = this.WebOptimizeCheckBox.Checked;
            setting.CheckUpdate = this.UpdateCheckBox.Checked;

            // 文書プロパティ
            setting.Document.Title = this.DocTitleTextBox.Text;
            setting.Document.Author = this.DocAuthorTextBox.Text;
            setting.Document.Subtitle = this.DocSubtitleTextBox.Text;
            setting.Document.Keyword = this.DocKeywordTextBox.Text;

            // パスワード
            if (this.OwnerPasswordCheckBox.Checked)
            {
                setting.Permission.Password = String.Copy(this.OwnerPasswordTextBox.Text);
                setting.Permission.AllowPrint = this.AllowPrintCheckBox.Checked;
                setting.Permission.AllowCopy = this.AllowCopyCheckBox.Checked;
                setting.Permission.AllowFormInput = this.AllowFormInputCheckBox.Checked;
                setting.Permission.AllowModify = this.AllowModifyCheckBox.Checked;

                if (this.RequiredUserPasswordCheckBox.Checked)
                {
                    setting.Password = String.Copy(this.UserPasswordCheckBox.Checked ? this.UserPasswordTextBox.Text : this.OwnerPasswordTextBox.Text);
                }
            }

            // ログ出力
            _messages.Add(new Message(Message.Levels.Debug, "CubePdf.MainForm.SaveSetting"));
            _messages.Add(new Message(Message.Levels.Debug, setting.ToString()));
        }
Пример #2
0
        /* ----------------------------------------------------------------- */
        ///
        /// SaveSetting
        /// 
        /// <summary>
        /// 各種 GUI コンポーネントの情報を UserSetting に反映します。
        /// </summary>
        ///
        /* ----------------------------------------------------------------- */
        private void SaveSetting(UserSetting setting)
        {
            setting.OutputPath  = GetDirectoryName(OutputPathTextBox.Text);
            setting.InputPath   = GetDirectoryName(InputPathTextBox.Text);
            setting.UserProgram = UserProgramTextBox.Text;

            // コンボボックスのインデックス関連
            setting.FileType     = Translator.ToFileType(FileTypeCombBox.SelectedIndex);
            setting.PDFVersion   = Translator.ToPdfVersion(PdfVersionComboBox.SelectedIndex);
            setting.Resolution   = Translator.ToResolution(ResolutionComboBox.SelectedIndex);
            setting.ExistedFile  = Translator.ToExistedFile(ExistedFileComboBox.SelectedIndex);
            setting.PostProcess  = Translator.ToPostProcess(_postproc.SelectedIndex);
            setting.DownSampling = Parameter.DownSamplings.Bicubic;

            // ラジオボタンのフラグ関連
            setting.Orientation  = PortraitRadioButton.Checked ? Parameter.Orientations.Portrait :
                LandscapeRadioButton.Checked ? Parameter.Orientations.Landscape : Parameter.Orientations.Auto;

            // チェックボックスのフラグ関連
            setting.EmbedFont    = EmbedFontCheckBox.Checked;
            setting.Grayscale    = GrayscaleCheckBox.Checked;
            setting.ImageFilter  = ImageFilterCheckBox.Checked ? Parameter.ImageFilters.DCTEncode : Parameter.ImageFilters.FlateEncode;
            setting.WebOptimize  = WebOptimizeCheckBox.Checked;
            setting.CheckUpdate  = UpdateCheckBox.Checked;

            // 文書プロパティ
            setting.Document.Title    = DocTitleTextBox.Text;
            setting.Document.Author   = DocAuthorTextBox.Text;
            setting.Document.Subtitle = DocSubtitleTextBox.Text;
            setting.Document.Keyword  = DocKeywordTextBox.Text;

            // セキュリティ
            if (OwnerPasswordCheckBox.Checked)
            {
                setting.Permission.Password       = OwnerPasswordTextBox.Text;
                setting.Permission.AllowPrint     = AllowPrintCheckBox.Checked;
                setting.Permission.AllowCopy      = AllowCopyCheckBox.Checked;
                setting.Permission.AllowFormInput = AllowFormInputCheckBox.Checked;
                setting.Permission.AllowModify    = AllowModifyCheckBox.Checked;

                if (RequiredUserPasswordCheckBox.Checked)
                {
                    setting.Password = UserPasswordCheckBox.Checked ? UserPasswordTextBox.Text : OwnerPasswordTextBox.Text;
                }
            }

            _messages.Add(new Message(Message.Levels.Debug, "CubePdf.MainForm.SaveSetting"));
            _messages.Add(new Message(Message.Levels.Debug, setting.ToString()));
        }
Пример #3
0
        /* ----------------------------------------------------------------- */
        ///
        /// LoadSetting
        /// 
        /// <summary>
        /// UserSetting の情報を各種 GUI コンポーネントに反映します。
        /// </summary>
        /// 
        /// <remarks>
        /// TODO: 仮想プリンタ経由の場合は InputPath にその値を設定する。
        /// </remarks>
        ///
        /* ----------------------------------------------------------------- */
        private void LoadSetting(UserSetting setting)
        {
            this.UserProgramTextBox.Text = setting.UserProgram;
            this.OutputPathTextBox.Text = setting.OutputPath;
            this.InputPathTextBox.Text = setting.InputPath;
            this.ConvertButton.Enabled = !string.IsNullOrEmpty(InputPathTextBox.Text);

            // コンボボックスのインデックス関連
            this.FileTypeCombBox.SelectedIndex = Translator.FileTypeToIndex(setting.FileType);
            this.PDFVersionComboBox.SelectedIndex = Translator.PDFVersionToIndex(setting.PDFVersion);
            this.ResolutionComboBox.SelectedIndex = Translator.ResolutionToIndex(setting.Resolution);
            this.ExistedFileComboBox.SelectedIndex = Translator.ExistedFileToIndex(setting.ExistedFile);
            this.DownSamplingComboBox.SelectedIndex = Translator.DownSamplingToIndex(setting.DownSampling);

            // チェックボックスのフラグ関連
            this.PageLotationCheckBox.Checked = setting.PageRotation;
            this.EmbedFontCheckBox.Checked = setting.EmbedFont;
            this.GrayscaleCheckBox.Checked = setting.Grayscale;
            this.ImageFilterCheckBox.Checked = (setting.ImageFilter == Parameter.ImageFilters.DCTEncode) ? true : false;
            this.WebOptimizeCheckBox.Checked = setting.WebOptimize;
            this.UpdateCheckBox.Checked = setting.CheckUpdate;

            // ポストプロセス関連
            _postproc = setting.AdvancedMode ? this.PostProcessComboBox : this.PostProcessLiteComboBox;
            _postproc.SelectedIndex = Math.Min(Translator.PostProcessToIndex(setting.PostProcess), Math.Max(_postproc.Items.Count - 1, 0));
            this.PostProcessPanel.Enabled = setting.AdvancedMode;
            this.PostProcessPanel.Visible = setting.AdvancedMode;
            this.PostProcessLabel.Visible = setting.AdvancedMode;
            this.PostProcessLiteComboBox.Enabled = !setting.AdvancedMode;
            this.PostProcessLiteComboBox.Visible = !setting.AdvancedMode;
            this.PostProcessLiteLabel.Visible = !setting.AdvancedMode;

            // 入力パスを選択可能にするかどうか
            this.InputPathLabel.Visible = setting.SelectInputFile;
            this.InputPathPanel.Visible = setting.SelectInputFile;
            this.InputPathPanel.Enabled = setting.SelectInputFile && setting.InputPath.Length == 0;

            // ログ出力
            _messages.Add(new Message(Message.Levels.Debug, "CubePdf.MainForm.LoadSetting"));
            _messages.Add(new Message(Message.Levels.Debug, setting.ToString()));
        }
Пример #4
0
        /* ----------------------------------------------------------------- */
        ///
        /// LoadSetting
        /// 
        /// <summary>
        /// UserSetting の情報を各種 GUI コンポーネントに反映します。
        /// </summary>
        /// 
        /// <remarks>
        /// TODO: 仮想プリンタ経由の場合は InputPath にその値を設定する。
        /// </remarks>
        ///
        /* ----------------------------------------------------------------- */
        private void LoadSetting(UserSetting setting)
        {
            UserProgramTextBox.Text = setting.UserProgram;
            OutputPathTextBox.Text  = setting.OutputPath;
            InputPathTextBox.Text   = setting.InputPath;
            ConvertButton.Enabled   = !string.IsNullOrEmpty(InputPathTextBox.Text);

            // コンボボックスのインデックス関連
            FileTypeCombBox.SelectedIndex      = Translator.ToIndex(setting.FileType);
            PdfVersionComboBox.SelectedIndex   = Translator.ToIndex(setting.PDFVersion);
            ResolutionComboBox.SelectedIndex   = Translator.ToIndex(setting.Resolution);
            ExistedFileComboBox.SelectedIndex  = Translator.ToIndex(setting.ExistedFile);

            // ラジオボタンのフラグ関連
            if (setting.Orientation == Parameter.Orientations.Portrait) PortraitRadioButton.Checked = true;
            else if (setting.Orientation == Parameter.Orientations.Landscape) LandscapeRadioButton.Checked = true;
            else AutoRadioButton.Checked = true;

            // チェックボックスのフラグ関連
            EmbedFontCheckBox.Checked    = setting.EmbedFont;
            GrayscaleCheckBox.Checked    = setting.Grayscale;
            ImageFilterCheckBox.Checked  = (setting.ImageFilter == Parameter.ImageFilters.DCTEncode) ? true : false;
            WebOptimizeCheckBox.Checked  = setting.WebOptimize;
            UpdateCheckBox.Checked       = setting.CheckUpdate;

            // ポストプロセス関連
            _postproc = setting.AdvancedMode ? PostProcessComboBox : PostProcessLiteComboBox;
            _postproc.SelectedIndex = Math.Min(Translator.ToIndex(setting.PostProcess), Math.Max(_postproc.Items.Count - 1, 0));
            PostProcessPanel.Enabled = setting.AdvancedMode;
            PostProcessPanel.Visible = setting.AdvancedMode;
            PostProcessLabel.Visible = setting.AdvancedMode;
            PostProcessLiteComboBox.Enabled = !setting.AdvancedMode;
            PostProcessLiteComboBox.Visible = !setting.AdvancedMode;
            PostProcessLiteLabel.Visible    = !setting.AdvancedMode;

            // 入力パスを選択可能にするかどうか
            InputPathLabel.Visible = setting.SelectInputFile;
            InputPathPanel.Visible = setting.SelectInputFile;
            InputPathPanel.Enabled = setting.SelectInputFile && setting.InputPath.Length == 0;

            _messages.Add(new Message(Message.Levels.Debug, "CubePdf.MainForm.LoadSetting"));
            _messages.Add(new Message(Message.Levels.Debug, setting.ToString()));
        }