コード例 #1
0
 public DailyMileLogon(DailyMileConnectionInfo connectionInfo)
     : base()
 {
     _connectionInfo = connectionInfo;
     InitializeComponent();
 }
コード例 #2
0
        public static bool SaveConnectionInfo(string fileName, DailyMileConnectionInfo info)
        {
            try
            {
                byte[] data = Serializers.Serialize(info);
                using (FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.Write, FileShare.None))
                {
                    fs.Write(data, 0, data.Length);
                }

                return true;
            }
            catch { }

            return false;
        }
コード例 #3
0
 public DailyMileAPI(DailyMileConnectionInfo connectionInfo)
 {
     _connectionInfo = connectionInfo;
 }
コード例 #4
0
ファイル: frmMain.cs プロジェクト: Romonaga/DailyMile-Backup
        private void SetupDMConnectionInfo()
        {
            _logger.EnQueueAppTraceMessage("SetupDMConnectionInfo() Enter");
            //IsTokenStillValid
            _dmConnectionInfo = DailyMileConnectionInfo.ReadConnectionInfo(_ConfigFileName);
            if (_dmConnectionInfo == null)
            {
                _logger.EnQueueAppTraceMessage("SetupDMConnectionInfo() Creating New");
                _dmConnectionInfo = new DailyMileConnectionInfo();
                _dmConnectionInfo.DailyMileURL = "https://api.dailymile.com";

                //Add your API Info here
                _dmConnectionInfo.RedirectURL = "";
                _dmConnectionInfo.ClientID = "";
                _dmConnectionInfo.ClientSecret = "";
                _dmConnectionInfo.IsLoggedIn = false;
                SetLoggedOnControlValues(false);
            }
            else
            {
                _logger.EnQueueAppTraceMessage("SetupDMConnectionInfo() Loaded");
                SetLoggedOnControlValues(_dmConnectionInfo.IsTokenStillValid);

            }

            _dmConnectionInfo.ConfigFileLocation = _ConfigFileName;

            _APIWrapper = new DailyMileAPI(_dmConnectionInfo);

            //LogonDailyMile
            _logger.EnQueueAppTraceMessage("SetupDMConnectionInfo() Leave");
        }