Exemplo n.º 1
0
        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());
                        }
            }
        }
Exemplo n.º 2
0
        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());
                        }
                    }
            }
        }