Example #1
0
 public MyTrelloApi(string authorizationToken = null, IUserInterface ui = null)
 {
     UI      = ui;
     _trello = new TrelloNet.Trello(ApplicationKey);
     if (string.IsNullOrEmpty(authorizationToken) || !TryAuthenticate(authorizationToken))
     {
         AuthorizationUrl = _trello.GetAuthorizationUrl("MyTrelloApi", Scope.ReadOnly, Expiration.Never);
         IsAuthorized     = false;
     }
 }
Example #2
0
 public string getURL()
 {
     return(trello.GetAuthorizationUrl("_GJDE", Scope.ReadWrite, Expiration.Never).ToString());
 }
        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);
        }
Example #4
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);
 }
        public void StartAuthorization(Expiration expiration)
        {
            var url = trello.GetAuthorizationUrl("TrelloExcel", Scope.ReadWrite, expiration);

            authorizeView.ShowAuthorizationDialog(url);
        }