예제 #1
0
        public SettingsForm(BoxConfiguration config)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            InitializeTexts();

            combobox_uploadimageformat.Items.Clear();
            foreach(OutputFormat format in Enum.GetValues(typeof(OutputFormat))) {
                combobox_uploadimageformat.Items.Add(format.ToString());
            }

            comboBox_DefaultSize.Items.Clear();
            foreach (PictureDisplaySize displaySize in Enum.GetValues(typeof(PictureDisplaySize)))
            {
                comboBox_DefaultSize.Items.Add(displaySize.ToString());
            }

            BoxUtils.LoadHistory();

            if (config.runtimeBoxHistory.Count > 0) {
                historyButton.Enabled = true;
            } else {
                historyButton.Enabled = false;
            }
        }
예제 #2
0
        public SettingsForm(BoxConfiguration config)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();
            InitializeTexts();

            combobox_uploadimageformat.Items.Clear();
            foreach (OutputFormat format in Enum.GetValues(typeof(OutputFormat)))
            {
                combobox_uploadimageformat.Items.Add(format.ToString());
            }

            comboBox_DefaultSize.Items.Clear();
            foreach (PictureDisplaySize displaySize in Enum.GetValues(typeof(PictureDisplaySize)))
            {
                comboBox_DefaultSize.Items.Add(displaySize.ToString());
            }

            BoxUtils.LoadHistory();

            if (config.runtimeBoxHistory.Count > 0)
            {
                historyButton.Enabled = true;
            }
            else
            {
                historyButton.Enabled = false;
            }
        }
예제 #3
0
        /// <summary>
        /// Implementation of the IGreenshotPlugin.Initialize
        /// </summary>
        /// <param name="host">Use the IGreenshotPluginHost interface to register events</param>
        /// <param name="pluginAttribute">My own attributes</param>
        public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes)
        {
            this.host  = (IGreenshotHost)pluginHost;
            Attributes = myAttributes;

            // Register configuration (don't need the configuration itself)
            config    = IniConfig.GetIniSection <BoxConfiguration>();
            resources = new ComponentResourceManager(typeof(BoxPlugin));

            ToolStripMenuItem itemPlugInRoot = new ToolStripMenuItem();

            itemPlugInRoot.Text  = "Box";
            itemPlugInRoot.Tag   = host;
            itemPlugInRoot.Image = (Image)resources.GetObject("Box");

            ToolStripMenuItem itemPlugInHistory = new ToolStripMenuItem();

            itemPlugInHistory.Text   = lang.GetString(LangKey.History);
            itemPlugInHistory.Tag    = host;
            itemPlugInHistory.Click += new System.EventHandler(HistoryMenuClick);
            itemPlugInRoot.DropDownItems.Add(itemPlugInHistory);

            ToolStripMenuItem itemPlugInConfig = new ToolStripMenuItem();

            itemPlugInConfig.Text   = lang.GetString(LangKey.Configure);
            itemPlugInConfig.Tag    = host;
            itemPlugInConfig.Click += new System.EventHandler(ConfigMenuClick);
            itemPlugInRoot.DropDownItems.Add(itemPlugInConfig);

            PluginUtils.AddToContextMenu(host, itemPlugInRoot);

            return(true);
        }
예제 #4
0
		public SettingsForm(BoxConfiguration config) {
			//
			// The InitializeComponent() call is required for Windows Forms designer support.
			//
			InitializeComponent();
			AcceptButton = buttonOK;
			CancelButton = buttonCancel;
		}
예제 #5
0
 public SettingsForm(BoxConfiguration config)
 {
     //
     // The InitializeComponent() call is required for Windows Forms designer support.
     //
     InitializeComponent();
     AcceptButton = buttonOK;
     CancelButton = buttonCancel;
 }
예제 #6
0
 public SettingsForm(BoxConfiguration config)
 {
     //
     // The InitializeComponent() call is required for Windows Forms designer support.
     //
     InitializeComponent();
     AcceptButton = buttonOK;
     CancelButton = buttonCancel;
     this.Icon    = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
 }
예제 #7
0
 public SettingsForm(BoxConfiguration config)
 {
     //
     // The InitializeComponent() call is required for Windows Forms designer support.
     //
     InitializeComponent();
     AcceptButton = buttonOK;
     CancelButton = buttonCancel;
     this.Icon = GreenshotPlugin.Core.GreenshotResources.getGreenshotIcon();
 }
예제 #8
0
        /// <summary>
        /// Implementation of the IGreenshotPlugin.Initialize
        /// </summary>
        /// <param name="host">Use the IGreenshotPluginHost interface to register events</param>
        /// <param name="metadata">IDictionary<string, object></param>
        /// <returns>true if plugin is initialized, false if not (doesn't show)</returns>
        public override bool Initialize(IGreenshotHost pluginHost, IDictionary <string, object> metadata)
        {
            this.host = (IGreenshotHost)pluginHost;

            // Register configuration (don't need the configuration itself)
            config    = IniConfig.GetIniSection <BoxConfiguration>();
            resources = new ComponentResourceManager(typeof(BoxPlugin));
            // Register our configuration
            SettingsWindow.RegisterSettingsPage <BoxSettingsPage>("settings_plugins,box.settings_title");
            return(true);
        }
예제 #9
0
		/// <summary>
		/// Implementation of the IGreenshotPlugin.Initialize
		/// </summary>
		/// <param name="pluginHost">Use the IGreenshotPluginHost interface to register events</param>
		/// <param name="pluginAttribute">My own attributes</param>
		public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute pluginAttribute) {
			_host = pluginHost;
			Attributes = pluginAttribute;

			// Register configuration (don't need the configuration itself)
			_config = IniConfig.GetIniSection<BoxConfiguration>();
			_resources = new ComponentResourceManager(typeof(BoxPlugin));

			_itemPlugInConfig = new ToolStripMenuItem {
				Image = (Image) _resources.GetObject("Box"),
				Text = Language.GetString("box", LangKey.Configure)
			};
			_itemPlugInConfig.Click += ConfigMenuClick;

			PluginUtils.AddToContextMenu(_host, _itemPlugInConfig);
			Language.LanguageChanged += OnLanguageChanged;
			return true;
		}
예제 #10
0
파일: BoxPlugin.cs 프로젝트: zhk/greenshot
        /// <summary>
        /// Implementation of the IGreenshotPlugin.Initialize
        /// </summary>
        /// <param name="pluginHost">Use the IGreenshotPluginHost interface to register events</param>
        /// <param name="pluginAttribute">My own attributes</param>
        public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute pluginAttribute)
        {
            _host      = pluginHost;
            Attributes = pluginAttribute;

            // Register configuration (don't need the configuration itself)
            _config    = IniConfig.GetIniSection <BoxConfiguration>();
            _resources = new ComponentResourceManager(typeof(BoxPlugin));

            _itemPlugInConfig = new ToolStripMenuItem {
                Image = (Image)_resources.GetObject("Box"),
                Text  = Language.GetString("box", LangKey.Configure)
            };
            _itemPlugInConfig.Click += ConfigMenuClick;

            PluginUtils.AddToContextMenu(_host, _itemPlugInConfig);
            Language.LanguageChanged += OnLanguageChanged;
            return(true);
        }
예제 #11
0
        /// <summary>
        /// Implementation of the IGreenshotPlugin.Initialize
        /// </summary>
        /// <param name="host">Use the IGreenshotPluginHost interface to register events</param>
        /// <param name="pluginAttribute">My own attributes</param>
        public virtual bool Initialize(IGreenshotHost pluginHost, PluginAttribute myAttributes)
        {
            this.host = (IGreenshotHost)pluginHost;
            Attributes = myAttributes;

            // Register configuration (don't need the configuration itself)
            config = IniConfig.GetIniSection<BoxConfiguration>();
            resources = new ComponentResourceManager(typeof(BoxPlugin));

            ToolStripMenuItem itemPlugInRoot = new ToolStripMenuItem();
            itemPlugInRoot.Text = "Box";
            itemPlugInRoot.Tag = host;
            itemPlugInRoot.Image = (Image)resources.GetObject("Box");

            ToolStripMenuItem itemPlugInHistory = new ToolStripMenuItem();
            itemPlugInHistory.Text = lang.GetString(LangKey.History);
            itemPlugInHistory.Tag = host;
            itemPlugInHistory.Click += new System.EventHandler(HistoryMenuClick);
            itemPlugInRoot.DropDownItems.Add(itemPlugInHistory);

            ToolStripMenuItem itemPlugInConfig = new ToolStripMenuItem();
            itemPlugInConfig.Text = lang.GetString(LangKey.Configure);
            itemPlugInConfig.Tag = host;
            itemPlugInConfig.Click += new System.EventHandler(ConfigMenuClick);
            itemPlugInRoot.DropDownItems.Add(itemPlugInConfig);

            PluginUtils.AddToContextMenu(host, itemPlugInRoot);

            return true;
        }