Ejemplo n.º 1
0
        public override bool Initialize(IPluginHost host)
        {
            var optionsMenu = new ToolStripMenuItem("&YandexDiskSync Settings ...");

            optionsMenu.Click += DisplayOptions;
            optionsMenu.Image  = Resources.disk_image;

            var openDb = new ToolStripMenuItem("Open &Yandex.Disk ...");

            openDb.Click       += DownloadDatabase;
            openDb.Image        = Resources.disk_image;
            openDb.ShortcutKeys = Keys.Control | Keys.Shift | Keys.Y;

            _host = host;
            _host.MainWindow.ToolsMenu.DropDownItems.Add(optionsMenu);
            var openFile = _host.MainWindow.MainMenu.Items.Find("m_menuFileOpen", true).FirstOrDefault() as ToolStripMenuItem;

            if (openFile != null)
            {
                openFile.DropDownItems.Add(openDb);
            }

            _host.MainWindow.FileOpened += OnOpenDatabase;
            _host.MainWindow.FileSaved  += OnSaveDatabase;

            Config = new Config(_host.CustomConfig);
            Api    = new ApiUI(Config);

            return(true);
        }
Ejemplo n.º 2
0
        public static FileInfo DownloadDatabase(ApiUI api)
        {
            var authForm = new DatabaseList(api);

            authForm.ShowDialog();

            return(authForm.File);
        }
Ejemplo n.º 3
0
 protected DatabaseList(ApiUI api)
 {
     _api = api;
     InitializeComponent();
 }