Showing the changes to Source/Applications/DataSubscriberTest/Program.cs (1 of 1382 files). Show all
Unified · Split
| @@ -5,10 +5,10 @@ · 4 unmodified lines | ||
| 5 | 5 | // |
| 6 | 6 | // Licensed to the Grid Protection Alliance (GPA) under one or more contributor license agreements. See |
| 7 | 7 | // the NOTICE file distributed with this work for additional information regarding copyright ownership. |
| 8 | −// The GPA licenses this file to you under the Eclipse Public License -v 1.0 (the "License"); you may | |
| 8 | +// The GPA licenses this file to you under the MIT License (MIT), the "License"; you may | |
| 9 | 9 | // not use this file except in compliance with the License. You may obtain a copy of the License at: |
| 10 | 10 | // |
| 11 | −// http://www.opensource.org/licenses/eclipse-1.0.php | |
| 11 | +// http://www.opensource.org/licenses/MIT | |
| 12 | 12 | // |
| 13 | 13 | // Unless agreed to in writing, the subject software distributed under the License is distributed on an |
| 14 | 14 | // "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. Refer to the |
| @@ -25,9 +25,11 @@ · 10 unmodified lines | ||
| 25 | 25 | |
| 26 | 26 | using System; |
| 27 | 27 | using System.Collections.Generic; |
| 28 | +using System.Data; | |
| 28 | 29 | using System.Text; |
| 29 | 30 | using System.Timers; |
| 30 | 31 | using GSF; |
| 32 | +using GSF.IO; | |
| 31 | 33 | using GSF.TimeSeries; |
| 32 | 34 | using GSF.TimeSeries.Transport; |
| 33 | 35 | using Random = GSF.Security.Cryptography.Random; |
| @@ -56,6 +58,7 @@ namespace DataSubscriberTest · 22 unmodified lines | ||
| 56 | 58 | subscriber.ConnectionEstablished += subscriber_ConnectionEstablished; |
| 57 | 59 | subscriber.ConnectionTerminated += subscriber_ConnectionTerminated; |
| 58 | 60 | subscriber.NewMeasurements += subscriber_NewMeasurements; |
| 61 | + subscriber.MetaDataReceived += subscriber_MetaDataReceived; | |
| 59 | 62 | |
| 60 | 63 | StringBuilder connectionString = new StringBuilder(); |
| 61 | 64 | |
| @@ -105,6 +108,13 @@ namespace DataSubscriberTest · 43 unmodified lines | ||
| 105 | 108 | timer.Stop(); |
| 106 | 109 | } |
| 107 | 110 | |
| 111 | + static void subscriber_MetaDataReceived(object sender, EventArgs<System.Data.DataSet> e) | |
| 112 | + { | |
| 113 | + DataSet dataSet = e.Argument; | |
| 114 | + dataSet.WriteXml(FilePath.GetAbsolutePath("Metadata.xml"), XmlWriteMode.WriteSchema); | |
| 115 | + Console.WriteLine("Data set serialized with {0} tables...", dataSet.Tables.Count); | |
| 116 | + } | |
| 117 | + | |
| 108 | 118 | static void timer_Elapsed(object sender, ElapsedEventArgs e) |
| 109 | 119 | { |
| 110 | 120 | if (subscriber.IsConnected) |
| @@ -175,6 +185,9 @@ namespace DataSubscriberTest · 64 unmodified lines | ||
| 175 | 185 | |
| 176 | 186 | static void subscriber_ConnectionEstablished(object sender, EventArgs e) |
| 177 | 187 | { |
| 188 | + | |
| 189 | + //subscriber.SendServerCommand(ServerCommand.MetaDataRefresh); | |
| 190 | + | |
| 178 | 191 | //// Request cipher key rotation |
| 179 | 192 | //subscriber.SendServerCommand(ServerCommand.RotateCipherKeys); |
| 180 | 193 | |