private void PatchProfiles(string oldConfigFile) { foreach (var pair in _appPathKeyMapping) { ConnectionDescription profile; if (_knownConnections._knownConnectionProfiles.TryGetValue(pair.Key, out profile)) { string pathMapping; if (_appPathKeyMapping.TryGetValue(profile.ConnectionTypeName, out pathMapping)) { var oldRepoValue = _xmlHelper.configGet(oldConfigFile, pathMapping); if (!string.IsNullOrEmpty(oldRepoValue)) { profile.AppPath = oldRepoValue; } } if (pair.Key == KnownConnections.Ssh().ConnectionTypeName) { PatchSshProfile(oldConfigFile, profile); } else if (pair.Key == KnownConnections.Rdp().ConnectionTypeName) { PatchRdpProfile(oldConfigFile, profile); } else if (pair.Key == KnownConnections.WinScpFtp().ConnectionTypeName || pair.Key == KnownConnections.WinScpScp().ConnectionTypeName || pair.Key == KnownConnections.WinScpSftp().ConnectionTypeName) { PatchWinScpProfile(oldConfigFile, profile); } else if (pair.Key == KnownConnections.Vnc().ConnectionTypeName) { PatchVncProfile(oldConfigFile, profile); } } } }
public OldRepositoryReader(string configFile, KnownConnections knownConnections) { _xmlHelper = new XmlHelper(); ConfigFile = configFile; _knownConnections = knownConnections; }
public NewRepositoryReader(KnownConnections knownConnections) { _knownConnections = knownConnections; }