private void Authenticate(string appKey, string userToken)
        {
            //TODO: tratar caso de appKey ou userToken inválido

            Trello = Trello ?? new TrelloNet.Trello(appKey);
            Trello.Authorize(userToken);
        }
        public TrelloService(TrelloSettings trelloSettings)
        {
            _trelloSettings = trelloSettings;

            _trello = new Trello(_trelloSettings.ApiKey);

            _trello.Authorize(_trelloSettings.Token);
        }
Example #3
0
		public void Setup()
		{
			_trelloReadOnly = new Trello(ConfigurationManager.AppSettings["ApplicationKey"]);
			_trelloReadOnly.Authorize(ConfigurationManager.AppSettings["MemberReadToken"]);

			_trelloReadWrite = new Trello(ConfigurationManager.AppSettings["ApplicationKey"]);
			_trelloReadWrite.Authorize(ConfigurationManager.AppSettings["MemberWriteToken"]);	
		}
        public void Setup()
        {
            _trelloReadOnly = new Trello(ConfigurationManager.AppSettings["ApplicationKey"]);
            _trelloReadOnly.Authorize(ConfigurationManager.AppSettings["MemberReadToken"]);

            _trelloReadWrite = new Trello(ConfigurationManager.AppSettings["ApplicationKey"]);
            _trelloReadWrite.Authorize(ConfigurationManager.AppSettings["MemberWriteToken"]);
        }
Example #5
0
        public TrelloHelper(Configuration configuration, ProjectsConfiguration projectsConfiguration)
        {
            _currentProjectId = projectsConfiguration.CurrentProjectId;
            _trello           = new Trello(configuration.Trello.ApiKey);
            _trello.Authorize(configuration.Trello.OAuthToken);
            var boardPlugins = _trello.Advanced.Get($"Boards/ZOUl8taI/boardPlugins").ToString();

            _trello.Advanced.Post("Boards/ZOUl8taI/boardPlugins", new { idPlugin = CustomFieldsPluginId });
            _currentBoardId = GetBoardForProject(projectsConfiguration);
        }
Example #6
0
 public TrelloClient(ITrelloConfig trelloConfig)
 {
     _trelloConfig = trelloConfig;
     _trello = Ioc.Container.Resolve<ITrello>(new ParameterOverride("key", _trelloConfig.TrelloKey));
     _trello.Authorize(_trelloConfig.TrelloToken);
     _lists = GetLists();
     _members = GetMembers();
     _cards = new List<TfsCard>();
     BoardId = new BoardId(trelloConfig.BoardId);
 }
Example #7
0
 public TrelloClient(ITrelloConfig trelloConfig)
 {
     _trelloConfig = trelloConfig;
     _trello       = Ioc.Container.Resolve <ITrello>(new ParameterOverride("key", _trelloConfig.TrelloKey));
     _trello.Authorize(_trelloConfig.TrelloToken);
     BoardId  = new BoardId(trelloConfig.BoardId);
     _lists   = GetLists();
     _members = GetMembers();
     _cards   = new List <TfsCard>();
 }
Example #8
0
 public ArchiverJob(ITrello trello = null, string key = null, string secret = null)
 {
     this._key       = key ?? System.Configuration.ConfigurationManager.AppSettings["trellokey"];
     this._authToken = System.Configuration.ConfigurationManager.AppSettings["trelloauthtoken"];
     this._trello    = trello ?? new Trello(this._key);
     if (_authToken == null)
     {
         string msg = "You must authorize this app for your trello account. Use the url: " + _trello.GetAuthorizationUrl("Trello Archiver", Scope.ReadWrite, Expiration.Never).ToString();
         _log.Fatal(msg);
         throw new ArgumentException(msg);
     }
     _trello.Authorize(this._authToken);
     _log.InfoFormat("Authorized with token {0}", this._authToken);
 }
Example #9
0
        public TrelloWorldService(ITrello trello, IAsyncTrello asyncTrello, Settings settings)
        {
            if (asyncTrello == null)
            {
                throw new ArgumentNullException();
            }
            if (trello == null)
            {
                throw new ArgumentNullException();
            }

            _trello = trello;
            _trello.Authorize(settings.Token);
            _asyncTrello = asyncTrello;
        }
Example #10
0
 public bool TryAuthenticate(string authorizationToken)
 {
     try
     {
         _trello.Authorize(authorizationToken);
         IsAuthorized = true;
         return(true);
     }
     catch (Exception ex)
     {
         UI?.Error($"Authentication failed! {ex}");
         IsAuthorized = true;
         return(false);
     }
 }
        public AuthorizePresenter(IAuthorizeView authorizeView, ITrello trello, IMessageBus messageBus)
        {
            this.authorizeView = authorizeView;
            this.trello        = trello;
            this.messageBus    = messageBus;

            authorizeView.AuthorizationTokenReceived += (sender, args) =>
            {
                trello.Authorize(args.Token);
                StoreTokenInSettings(args.Token);

                authorizeView.Hide();

                trello.Async.Members.Me()
                .ContinueWith(t => messageBus.Publish(new TrelloWasAuthorizedEvent(t.Result)));
            };
        }
Example #12
0
 public void refreshData()
 {
     if (token != null && key != null)
     {
         if (trello == null)
         {
             trello = new Trello(key);
             trello.Authorize(token);
             enabled = true;
         }
         if (board == "")
         {
             getBoards();
         }
         else
         {
             getCards();
         }
     }
 }
        private static void Main(string[] args)
        {
            if (!System.IO.File.Exists(File)) throw new FileNotFoundException(File);

            _pck = new ExcelPackage(new FileInfo(File));

            GetColumnIndexes();

            const string milestone = "Screens";
            _devCards = ExtractDevCards().Where(a => a.Milestone == milestone && a.EstimatedHours > 0).ToList();

            _trello = new Trello("7b17eb1ed849a91c051da9c924f93cfb");
            var url = _trello.GetAuthorizationUrl("userstorydataloader", Scope.ReadWrite);
            //Process.Start(url.AbsoluteUri);
            _trello.Authorize("db2c728bfd1b4cca3e07c0176e6ac3208fd4f363f383f9e0a2ac74081da4cd95");

            _board = _trello.Boards.WithId("55a8cdfd9536d1d4a332691f");
            _backlog = _trello.Lists
                .ForBoard(_board)
                .FirstOrDefault(a => a.Name == "Backlog");

            _lbls = _trello.Labels.ForBoard(_board);

            AddCards(_devCards, _backlog, _trello, _count);
            Thread.Sleep(5000);
            AddAcceptanceCriteria(_backlog, _board);
            Thread.Sleep(5000);
            AddLabels(_backlog, _board);
        }