Example #1
0
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            Trello = new Trello("1ed8d91b5af35305a60e169a321ac248");
            MessageBus = new MessageBus();

            var exportCardsControl = new ExportCardsControl();
            var importCardsControl = new ImportCardsControl();
            var authorizeForm = new AuthorizationDialog();

            ExportCardsTaskPane = CustomTaskPanes.Add(exportCardsControl, "Export cards to Trello");
            ExportCardsTaskPane.Width = 300;
            ExportCardsTaskPane.DockPositionRestrict = MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoHorizontal;

            ImportCardsTaskPane = CustomTaskPanes.Add(importCardsControl, "Import cards from Trello");
            ImportCardsTaskPane.Width = 300;
            ImportCardsTaskPane.DockPositionRestrict = MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoHorizontal;

            TaskScheduler = TaskScheduler.FromCurrentSynchronizationContext();

            ExportCardsPresenter = new ExportCardsPresenter(exportCardsControl, Trello, new GridToNewCardTransformer(), TaskScheduler, MessageBus);
            ImportCardsPresenter = new ImportCardsPresenter(importCardsControl, MessageBus, Trello, TaskScheduler);
            AuthorizePresenter = new AuthorizePresenter(authorizeForm, Trello, MessageBus);

            Globals.Ribbons.TrelloRibbon.SetMessageBus(MessageBus);

            TryToAuthorizeTrello();
        }
Example #2
-1
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            Trello     = new Trello("1ed8d91b5af35305a60e169a321ac248");
            MessageBus = new MessageBus();

            var exportCardsControl = new ExportCardsControl();
            var importCardsControl = new ImportCardsControl();
            var authorizeForm      = new AuthorizationDialog();

            ExportCardsTaskPane       = CustomTaskPanes.Add(exportCardsControl, "Export cards to Trello");
            ExportCardsTaskPane.Width = 300;
            ExportCardsTaskPane.DockPositionRestrict = MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoHorizontal;

            ImportCardsTaskPane       = CustomTaskPanes.Add(importCardsControl, "Import cards from Trello");
            ImportCardsTaskPane.Width = 300;
            ImportCardsTaskPane.DockPositionRestrict = MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoHorizontal;

            TaskScheduler = TaskScheduler.FromCurrentSynchronizationContext();

            ExportCardsPresenter = new ExportCardsPresenter(exportCardsControl, Trello, new GridToNewCardTransformer(), TaskScheduler, MessageBus);
            ImportCardsPresenter = new ImportCardsPresenter(importCardsControl, MessageBus, Trello, TaskScheduler);
            AuthorizePresenter   = new AuthorizePresenter(authorizeForm, Trello, MessageBus);

            Globals.Ribbons.TrelloRibbon.SetMessageBus(MessageBus);

            TryToAuthorizeTrello();
        }