本文整理汇总了C#中Record.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# Record.Dispose方法的具体用法?C# Record.Dispose怎么用?C# Record.Dispose使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Record
的用法示例。
在下文中一共展示了Record.Dispose方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DisposeTest
public void DisposeTest()
{
var record = new Record("data/100s");
record.Open();
Assert.IsFalse(record.IsNew);
//Assert.AreEqual(" 69 M 1085 1629 x1", record.Info);
Assert.AreEqual((Frequency)360, record.SamplingFrequency);
Assert.AreEqual(2, record.Signals.Count());
record.Dispose();
Assert.AreEqual(0, record.Signals.Count());
Assert.IsTrue(record.IsNew);
Assert.AreEqual(string.Empty, record.Info);
Assert.AreEqual((Frequency)0, record.SamplingFrequency);
Assert.AreEqual(0, record.Signals.Count());
}
示例2: UsingWrapperClasses
public static void UsingWrapperClasses()
{
var record = new Record("data/100s");
record.Open();
Console.WriteLine("Record Name : " + record.Name);
Console.WriteLine("Record Info : " + record.Info);
Console.WriteLine("Record's Sampling Frequency : " + record.SamplingFrequency);
Console.WriteLine("Available signals.");
foreach (Signal signal in record.Signals)
{
Console.WriteLine("=====================================");
Console.WriteLine("Signal's Name : " + signal.FileName);
Console.WriteLine("Signal's Description : " + signal.Description);
Console.WriteLine("Signal's Number of samples : " + signal.NumberOfSamples);
Console.WriteLine("Signal's First Sample : " + signal.InitValue);
Console.WriteLine("------------------------------------------");
Console.WriteLine("Showing the first 10 samples of the signal");
Console.WriteLine("------------------------------------------");
List<Sample> samples = signal.ReadNext(10).ToList();
for (int i = 0; i < samples.Count; i++)
{
Console.WriteLine("Sample " + i + " Value (adu) = " + samples[i].Adu);
Console.WriteLine(" Value (microvolt) = " + samples[i].ToMicrovolts());
Console.WriteLine(" Value (millivolt) = " + samples[i].ToPhys());
}
Console.WriteLine("--------------------------------------");
Console.WriteLine("=====================================");
}
record.Dispose();
}