/// ------------------------------------------------------------------------------------ /// <summary> /// /// </summary> /// ------------------------------------------------------------------------------------ public static SkippedDataSourceList Load(PaProject project) { if (project != null) { SkippedDataSourceList sdsl = new SkippedDataSourceList(); foreach (PaDataSource ds in project.DataSources) { sdsl[ds.ToString(true)] = false; } string filename = project.ProjectPathFilePrefix + kDataSourceInfoFilePrefix; if (File.Exists(filename)) { InternalSkipList skipList = STUtils.DeserializeData(filename, typeof(InternalSkipList)) as InternalSkipList; if (skipList != null) { foreach (string dsName in skipList) { if (sdsl.ContainsKey(dsName)) { sdsl[dsName] = true; } } } } return(sdsl); } return(new SkippedDataSourceList()); }
/// ------------------------------------------------------------------------------------ /// <summary> /// /// </summary> /// ------------------------------------------------------------------------------------ public void Save(PaProject project) { if (project != null) { InternalSkipList skipList = new InternalSkipList(); foreach (KeyValuePair <string, bool> kvp in this) { if (kvp.Value) { skipList.Add(kvp.Key); } } string filename = project.ProjectPathFilePrefix + kDataSourceInfoFilePrefix; STUtils.SerializeData(filename, skipList); } }