Inheritance: ISettings
コード例 #1
0
        public string ReadApiKey(string source)
        {
            var settings = new UserSettings(new PhysicalFileSystem(Environment.CurrentDirectory));
            string key = settings.GetDecryptedValue(ApiKeysSectionName, source);

            if (String.IsNullOrEmpty(key))
            {
                if (IsFirstTimeAfterUpdate && source.Equals(NuGetConstants.V2LegacyFeedUrl, StringComparison.OrdinalIgnoreCase))
                {
                    key = Settings.Default.PublishPrivateKey;
                }
            }

            return key;
        }
コード例 #2
0
ファイル: SettingsManager.cs プロジェクト: jacksonh/nuget
 public void WriteApiKeyToSettingFile(string apiKey)
 {
     var settings = new UserSettings(new PhysicalFileSystem(Environment.CurrentDirectory));
     settings.SetEncryptedValue(ApiKeysSectionName, PublishPackageLocation, apiKey);
 }
コード例 #3
0
ファイル: SettingsManager.cs プロジェクト: jacksonh/nuget
 public string ReadApiKeyFromSettingFile()
 {
     var settings = new UserSettings(new PhysicalFileSystem(Environment.CurrentDirectory));
     string key = settings.GetDecryptedValue(ApiKeysSectionName, PublishPackageLocation);
     return key ?? Properties.Settings.Default.PublishPrivateKey;
 }
コード例 #4
0
 public void WriteApiKey(string source, string apiKey)
 {
     var settings = new UserSettings(new PhysicalFileSystem(Environment.CurrentDirectory));
     settings.SetEncryptedValue(ApiKeysSectionName, source, apiKey);
 }