public void ReadData() { Logger.Console.Verbose = VerboseLevel.All; using (SnapServer server = CreateServer()) { using (SnapClient client = SnapClient.Connect(server)) using (ClientDatabaseBase <HistorianKey, HistorianValue> db = client.GetDatabase <HistorianKey, HistorianValue>("PPA")) using (TreeStream <HistorianKey, HistorianValue> stream = db.Read(null, null, null)) { Console.WriteLine(stream.Count()); } } }
public void DetatchFiles() { Logger.Console.Verbose = VerboseLevel.All; using (SnapServer server = CreateServer()) { using (SnapClient client = SnapClient.Connect(server)) using (ClientDatabaseBase <HistorianKey, HistorianValue> db = client.GetDatabase <HistorianKey, HistorianValue>("PPA")) { using (TreeStream <HistorianKey, HistorianValue> stream = db.Read(null, null, null)) { Console.WriteLine(stream.Count()); } db.DetatchFiles(db.GetAllAttachedFiles().Select(x => x.Id).ToList()); using (TreeStream <HistorianKey, HistorianValue> stream = db.Read(null, null, null)) { Console.WriteLine(stream.Count()); } } } }