Example #1
0
        private void MiUploader_Click(object sender, RoutedEventArgs e)
        {
            MenuItem mi = sender as MenuItem;
            IShareXUploaderPlugin uploader = Uploader.PluginManager.GetUploader(mi.Header.ToString());

            if (uploader != null)
            {
                UploadResult result = uploader.Upload(editor.GetStream(), "Test.png");
                if (result != null)
                {
                    Clipboard.SetText(result.URL);
                }
            }
        }
        public void Init(string folderPath)
        {
            Plugins = PluginHelper <IShareXUploaderPlugin> .LoadPlugins(folderPath);

            OnPluginsLoaded();

            if (Plugins != null)
            {
                foreach (var plugin in Plugins)
                {
                    IShareXUploaderPlugin uploader = plugin.Value;
                    uploader.Location = plugin.Key;
                    uploader.LoadSettings(Path.ChangeExtension(uploader.Location, "json"));
                }
            }
        }
Example #3
0
        public UploaderConfigWindow()
        {
            InitializeComponent();

            if (Uploader.PluginManager.Plugins != null)
            {
                foreach (var plugin in Uploader.PluginManager.Plugins)
                {
                    IShareXUploaderPlugin uploader = plugin.Value;

                    LeftDrawerContentItem lbItem = new LeftDrawerContentItem()
                    {
                        Name    = uploader.Name,
                        Content = uploader.UI
                    };

                    lbDrawer.Items.Add(lbItem);
                }
            }
        }