program.cs

来自「用C#實現能產生PDF格式文件的源碼」· CS 代码 · 共 57 行

CS
57
字号
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using PdfSharp.Pdf;
using PdfSharp.Pdf.IO;

namespace PdfSharp.Explorer
{
  /// <summary>
  /// Entry class of PDFshpar Explorer.
  /// </summary>
  public class Program
  {
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main(string[] args) 
    {
      ExplorerProcess process = new ExplorerProcess();
      if (args.Length < 2)
      {
        if (args.Length == 1)
        {
          try
          {
            process.OpenDocument(args[0]);
          }
          catch (Exception ex)
          {
            MessageBox.Show(ex.Message, VersionInfo.Title);
            return;
          }
        }
        Application.Run(new MainForm(process));
      }
      else
      {
        switch (args[1])
        {
          case "/format":
            process.FormatDocument(args[0]);
            break;

          default:
            MessageBox.Show("Invalid command: '" + args[0] + "'.", VersionInfo.Title);
            break;
        }
      }
    }
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?