示例#1
0
        public MainForm(CopyDataTransport dataTransport)
        {
            instance = this;
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            lang = Language.GetInstance();
            IniConfig.IniChanged += new FileSystemEventHandler(ReloadConfiguration);

            // Make sure all hotkeys pass this window!
            HotkeyControl.RegisterHotkeyHWND(this.Handle);
            RegisterHotkeys();

            tooltip = new ToolTip();

            UpdateUI();
            InitializeQuickSettingsMenu();

            captureForm = new CaptureForm();

            // Load all the plugins
            PluginHelper.instance.LoadPlugins(this, captureForm);
            SoundHelper.Initialize();

            // Enable the Greenshot icon to be visible, this prevents Problems with the context menu
            notifyIcon.Visible = true;

            // Create a new instance of the class: copyData = new CopyData();
            copyData = new CopyData();

            // Assign the handle:
            copyData.AssignHandle(this.Handle);
            // Create the channel to send on:
            copyData.Channels.Add("Greenshot");
            // Hook up received event:
            copyData.CopyDataReceived += new CopyDataReceivedEventHandler(CopyDataDataReceived);

            if (dataTransport != null)
            {
                HandleDataTransport(dataTransport);
            }
            ClipboardHelper.RegisterClipboardViewer(this.Handle);
        }