示例#1
0
        public GetToken()
        {
            InitializeComponent();
            string _tokenurl = Properties.Settings.Default["tokenUrl"] as string;

            if (string.IsNullOrEmpty(_tokenurl))
            {
                _tokenurl = "http://localhost:9000/token";
            }
            string _username = Properties.Settings.Default["userName"] as string;

            if (string.IsNullOrEmpty(_username))
            {
                _username = "";
            }
            string _password = Properties.Settings.Default["password"] as string;

            if (string.IsNullOrEmpty(_username))
            {
                _password = "";
            }
            textBox_tokenUrl.Text = _tokenurl;
            textBox_userName.Text = _username;
            textBox_password.Text = _password;
            _apiRequester         = new APIRequester();
        }
示例#2
0
 public DataExporter(APIRequester apiRequester)
 {
     _apiRequester = apiRequester;
     InitializeComponent();
     textBox_tokenText.Text = _apiRequester.user.token;
     textBox_userName.Text  = _apiRequester.user.userName;
     _apiRequester.DelegGroupProgressTextChange     = new ControlChanger(ChangeGroupProgressText);
     _apiRequester.DelegTaskProgressTextChange      = new ControlChanger(ChangeTaskProgressText);
     _apiRequester.DelegAddGroupIntoListView        = new ControlChanger(AddGroupsIntoListView);
     _apiRequester.DelegAddProgressInfoIntoListView = new ControlChanger(AddProgressIntoListView);
     _apiRequester.DelegProgressChange      = new ProgressChanger(SetProgressBarValue);
     _apiRequester.DelegGroupProgressChange = new ProgressChanger(SetGroupProgressBarValue);
     textBox_savePath.Text    = System.Environment.CurrentDirectory;
     label_groupProgress.Text = "";
     label_taskProgress.Text  = "";
 }