/// <summary> /// Deserialize the TFS settings from the specified configuration file. /// </summary> /// <param name="path">The TFS settings file to load.</param> public static void Load(string path) { if (!File.Exists(path)) { TfsSettings.Default.ResetSettings(); return; } FileStream fileStream = null; try { fileStream = File.OpenRead(path); using (XmlReader reader = XmlReader.Create(fileStream)) { fileStream = null; XmlSerializer xml = new XmlSerializer(typeof(TfsSettings)); TfsSettings settings = (TfsSettings)xml.Deserialize(reader); settings.LoadedSettingsPath = Path.GetFullPath(path); reader.Close(); TfsSettings.Default.CopySettings(settings); } } finally { if (fileStream != null) { fileStream.Dispose(); fileStream = null; } } }
private void LoadTfsSettings() { if (string.IsNullOrEmpty(this.projectPath)) { TfsSettings.Load(null); } else { TfsSettings.Load(Path.Combine(this.projectPath, @"ProjectSettings\TfsSettings.xml")); } }
private void CopySettings(TfsSettings settings) { this.LoadedSettingsPath = settings.LoadedSettingsPath; this.allowSavingLockedExclusiveFiles = settings.allowSavingLockedExclusiveFiles; this.connectionString = settings.connectionString; this.exclusiveCheckoutFileTypes = settings.exclusiveCheckoutFileTypes; this.ignoreUsers = settings.ignoreUsers; this.lockLevels = settings.lockLevels; this.shareBinaryFileCheckout = settings.shareBinaryFileCheckout; this.tfsIgnore = settings.tfsIgnore; this.tfsNoLock = settings.tfsNoLock; }