Beispiel #1
0
        /// <inheritdoc />
        public override void LoadConfiguration()
        {
            Dictionary <string, object> properties =
                new Dictionary <string, object>
            {
                { "TargetPath", this.Config.TargetPath },
                { "LatestDeltaToken", this.Config.LatestDeltaToken }
            };

            // The token is normally encrypted in the Configuration object. Because we need to have it
            // in memory and unencrypted to use it, we keep a second (unencrypted) copy of the token
            // locally in the adapter.
            if (this.Config.CurrentToken != null)
            {
                this.CurrentToken = this.Config.CurrentToken.DuplicateToken();
                this.CurrentToken.Unprotect();

                properties.Add(
                    "CurrentToken",
                    string.Format(
                        "AcquireTime={0}, AccessTokenHash={1}, RefreshTokenHash={2}",
                        this.CurrentToken.AcquireTime,
                        this.CurrentToken.GetAccessTokenHash(),
                        this.CurrentToken.GetRefreshTokenHash()));
            }
            else
            {
                properties.Add("CurrentToken", "(null)");
            }

            Logger.AdapterLoaded(
                "OneDriveAdapter",
                OneDriveAdapter.TargetTypeId,
                properties);
        }