コード例 #1
0
ファイル: Program.cs プロジェクト: yjsyyyjszf/DIAS
        static void TestJson()
        {
            DicomStation station = new DicomStation(StationCategories.Server)
            {
                AE        = "a",
                IPAddress = null,
            };

            //string output = JsonConvert.SerializeObject(station);
            //Console.WriteLine(output);

            JsonSerializer serializer = new JsonSerializer();

            using (StreamWriter fs = new StreamWriter(@"D:\dias.json"))
            {
                using (JsonWriter writer = new JsonTextWriter(fs))
                {
                    serializer.Serialize(writer, station);
                }
            }

            using (StreamReader sr = File.OpenText(@"C:\Users\fmisx\Desktop\AadProvider.Configuration.json"))
            {
                JObject o = (JObject)JToken.ReadFrom(new JsonTextReader(sr));
                Parallel.ForEach(o.AsJEnumerable(), item =>
                {
                    Console.WriteLine($"{item}");
                });
            }
        }
コード例 #2
0
        /// <summary>
        /// Test if the dicom station can be connected.
        /// Throw exception if the connecting fails.
        /// </summary>
        /// <param name="dicomStation"><see cref="DataModel.DicomStation"/></param>
        public static async Task TestConnectionAsync(this DicomStation dicomStation)
        {
            var client = new DicomClient();

            client.NegotiateAsyncOps();
            client.AddRequest(new DicomCEchoRequest());
            await client.SendAsync(dicomStation.IPAddress, dicomStation.Port, false, "Test", dicomStation.AE);
        }
コード例 #3
0
ファイル: FoUploader.cs プロジェクト: yjsyyyjszf/DIAS
        public async Task UploadAsync(IEnumerable <string> filenames, DicomStation dicomStation)
        {
            var client = new DicomClient();

            // Create request and push to queue.
            foreach (var item in filenames)
            {
                client.AddRequest(new DicomCStoreRequest(item));
            }
            // Send the request.
            await client.SendAsync(dicomStation.IPAddress, dicomStation.Port, false, _callingAE, dicomStation.AE);
        }
コード例 #4
0
ファイル: FoUploader.cs プロジェクト: yjsyyyjszf/DIAS
 public async Task UploadAsync(string filename, DicomStation dicomStation)
 {
     await UploadAsync(new string[] { filename }, dicomStation);
 }
コード例 #5
0
ファイル: FoUploader.cs プロジェクト: yjsyyyjszf/DIAS
 public void Upload(string filename, DicomStation dicomStation)
 {
     Upload(new string[] { filename }, dicomStation);
 }