当前位置: 首页>>代码示例>>C#>>正文


C# SampleType类代码示例

本文整理汇总了C#中SampleType的典型用法代码示例。如果您正苦于以下问题:C# SampleType类的具体用法?C# SampleType怎么用?C# SampleType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SampleType类属于命名空间,在下文中一共展示了SampleType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WriteFile2

        public void WriteFile2()
        {
            var engine = new FileHelperEngine<SampleType>();

            var res = new SampleType[2];

            res[0] = new SampleType();
            res[1] = new SampleType();

            res[0].Field1 = DateTime.Now.AddDays(1);
            res[0].Field2 = "je";
            res[0].Field3 = 0;

            res[1].Field1 = DateTime.Now;
            res[1].Field2 = "ho";
            res[1].Field3 = 2;

            engine.WriteFile(@"miprueba.txt", res, -10);

            res = (SampleType[]) engine.ReadFile(@"miprueba.txt");

            if (File.Exists(@"miprueba.txt"))
                File.Delete(@"miprueba.txt");

            Assert.AreEqual(2, res.Length);
        }
开发者ID:rohancragg,项目名称:FileHelpers,代码行数:26,代码来源:WritersMaxRecords.cs

示例2: P25Decoder

        public P25Decoder(int sampleRate, SampleType sampleType)
            : base(sampleType)
        {
            if (sampleType == SampleType.COMPLEX) //JG This is used when listening to the raw feed, not demodulated.
            {
                mBasebandFilter = new DSP.Filter.ComplexFIRFilter(DSP.Filter.FilterFactory.getLowPass(sampleRate, 5000, 31, WindowType.HAMMING), 1.0);
                this.addComplexListener(mBasebandFilter);
                mBasebandFilter.SetListener(mDemodulator);
                mDemodulator.setListener(getRealReceiver());
            }

            mSymbolFilter = new DSP.Filter.C4FMSymbolFilter(sampleRate);
            addRealSampleListener(mSymbolFilter);
            mSymbolFilter.SetOutputListener(mSlicer);

            mMessageProcessor = new DSP.FSK.P25MessageProcessor();
            
            mNormalFramer = new DSP.FSK.P25MessageFramer(P25.FrameSync.P25_PHASE1.getSync(), 64, false);
            mSlicer.AddListener(mNormalFramer);
            mNormalFramer.setListener(mMessageProcessor);

            mInvertedFramer = new DSP.FSK.P25MessageFramer(P25.FrameSync.P25_PHASE1_INVERTED.getSync(), 64, true);
            mSlicer.AddListener(mInvertedFramer);
            mInvertedFramer.setListener(mMessageProcessor);

            mMessageProcessor.addMessageListener(this);
        }
开发者ID:JoeGilkey,项目名称:RadioLog,代码行数:27,代码来源:P25Decoder.cs

示例3: WriteEvents

		public void WriteEvents()
		{
			before = 0;
			after = 0;

            engine = new FileHelperEngine<SampleType>();

            engine.BeforeWriteRecord += engine_BeforeWriteRecord;
			engine.AfterWriteRecord += engine_AfterWriteRecord;

            SampleType[] res = new SampleType[2];

			res[0] = new SampleType();
			res[1] = new SampleType();

			res[0].Field1 = DateTime.Now.AddDays(1);
			res[0].Field2 = "je";
			res[0].Field3 = 0;

			res[1].Field1 = DateTime.Now;
			res[1].Field2 = "ho";
			res[1].Field3 = 2;

			engine.WriteString(res);

			Assert.AreEqual(2, engine.TotalRecords);
			Assert.AreEqual(2, before);
			Assert.AreEqual(2, after);

		}
开发者ID:BD-GitHub,项目名称:filehelpers,代码行数:30,代码来源:EventsGenerics.cs

示例4: WriteFileNotifyPercent

        public void WriteFileNotifyPercent()
        {
            actualPerc = 0;
            actualAdd = 50;

            var engine = new FileHelperEngine<SampleType>();
            engine.Progress += ProgressChangePercent;

            var res = new SampleType[2];

            res[0] = new SampleType();
            res[1] = new SampleType();

            res[0].Field1 = DateTime.Now.AddDays(1);
            res[0].Field2 = "je";
            res[0].Field3 = 0;

            res[1].Field1 = DateTime.Now;
            res[1].Field2 = "ho";
            res[1].Field3 = 2;

            engine.WriteFile("prog1.txt", res);
            if (File.Exists("prog1.txt"))
                File.Delete("prog1.txt");
        }
开发者ID:calebillman,项目名称:FileHelpers,代码行数:25,代码来源:Progress.cs

示例5: WriteStream

		public void WriteStream()
		{
			engine = new FileHelperEngine(typeof (SampleType));

			SampleType[] res = new SampleType[2];

			res[0] = new SampleType();
			res[1] = new SampleType();

			res[0].Field1 = DateTime.Now.AddDays(1);
			res[0].Field2 = "je";
			res[0].Field3 = 0;

			res[1].Field1 = DateTime.Now;
			res[1].Field2 = "ho";
			res[1].Field3 = 2;

			StringBuilder sb = new StringBuilder();
			StringWriter writer = new StringWriter(sb);
			engine.WriteStream(writer, res, 1);

			Assert.AreEqual(14 + 2, sb.ToString().Length);
			Assert.AreEqual(sb.ToString(0, 8), DateTime.Now.AddDays(1).ToString("ddMMyyyy"));

		}
开发者ID:BD-GitHub,项目名称:filehelpers,代码行数:25,代码来源:WritersMaxRecords.cs

示例6: RandomAttribute

 /// <summary>
 /// Construct a set of doubles from min to max
 /// </summary>
 /// <param name="min"></param>
 /// <param name="max"></param>
 /// <param name="count"></param>
 public RandomAttribute(double min, double max, int count)
 {
     this.count = count;
     this.dmin = min;
     this.dmax = max;
     this.sampleType = SampleType.DoubleRange;
 }
开发者ID:antonovicha,项目名称:EmitMapperRedux,代码行数:13,代码来源:RandomAttribute.cs

示例7: SampleDefinition

 public SampleDefinition(string name, Type pageType, SampleType sampleType, SampleCategory sampleArea)
 {
     _name           = name;
     _pageType       = pageType;
     _sampleType     = sampleType;
     _sampleCategory = sampleArea;
 }
开发者ID:chenjianwp,项目名称:WindowsUIDevLabs,代码行数:7,代码来源:SampleDefinition.cs

示例8: AppendToFile

        public void AppendToFile()
        {
            var engine = new FileHelperEngine<SampleType>();

            var res = new SampleType[2];

            res[0] = new SampleType();
            res[1] = new SampleType();

            res[0].Field1 = DateTime.Now.AddDays(1).Date;
            res[0].Field2 = "je";
            res[0].Field3 = 0;

            res[1].Field1 = DateTime.Now.Date;
            res[1].Field2 = "ho";
            res[1].Field3 = 2;

            engine.WriteFile(@"test.txt", res);
            engine.AppendToFile(@"test.txt", res);

            var res2 = (SampleType[]) engine.ReadFile(@"test.txt");

            Assert.AreEqual(4, res2.Length);
            Assert.AreEqual(res[0].Field1, res2[0].Field1);
            Assert.AreEqual(res[1].Field1, res2[1].Field1);
            Assert.AreEqual(res[0].Field1, res2[2].Field1);
            Assert.AreEqual(res[1].Field1, res2[3].Field1);
        }
开发者ID:calebillman,项目名称:FileHelpers,代码行数:28,代码来源:AppendWriters.cs

示例9: AppendOneToFile

        public void AppendOneToFile()
        {
            engine = new FileHelperEngine(typeof (SampleType));

            SampleType[] res = new SampleType[2];

            res[0] = new SampleType();
            res[1] = new SampleType();

            res[0].Field1 = DateTime.Now.AddDays(1).Date;
            res[0].Field2 = "je";
            res[0].Field3 = 0;

            res[1].Field1 = DateTime.Now.Date;
            res[1].Field2 = "ho";
            res[1].Field3 = 2;

            engine.WriteFile(@"test.txt", res);

            SampleType record = new SampleType();

            record.Field1 = DateTime.Now.Date;
            record.Field2 = "h2";
            record.Field3 = 2;

            engine.AppendToFile(@"test.txt", record);

            SampleType[] res2 = (SampleType[]) engine.ReadFile(@"test.txt");

            Assert.AreEqual(3, res2.Length);
            Assert.AreEqual(res[0].Field1, res2[0].Field1);
            Assert.AreEqual(res[1].Field1, res2[1].Field1);
            Assert.AreEqual(DateTime.Now.Date, res2[2].Field1);
        }
开发者ID:hoffmanc,项目名称:FileHelpers,代码行数:34,代码来源:AppendWriters.cs

示例10: InsMethodOverload

        public void InsMethodOverload()
        {
            SampleType x = new SampleType();

            Assert.That(
                MethodCall.Invoke(x, "XBaseInsMethod", 10),
                Is.EqualTo("XBaseInsMethod(int i)"));
        }
开发者ID:ppanyukov,项目名称:MethodCall,代码行数:8,代码来源:MethodCall.Tests.cs

示例11: FormAddNew

        public FormAddNew(SampleType table)
        {
            InitializeComponent();
            InitializeOpenFileDialog();

            _tableType = table;
            tables = new DataGridView[] { dataGridViewNew, dataGridViewMil, dataGridViewMed, dataGridViewPsy, dataGridViewFamily, dataGridViewSocial, dataGridViewStudy, dataGridViewWork };
            FillTable();
        }
开发者ID:KinTT,项目名称:PsyWin,代码行数:9,代码来源:FormAddNew.cs

示例12: InsField

        public void InsField()
        {
            SampleType x = new SampleType();

            MethodCall.SetField(x, "baseInsField", "la la");

            Assert.That(
                MethodCall.GetField(x, "baseInsField"),
                Is.EqualTo("la la"));
        }
开发者ID:ppanyukov,项目名称:MethodCall,代码行数:10,代码来源:MethodCall.Tests.cs

示例13: InsProp

        public void InsProp()
        {
            SampleType x = new SampleType();

            MethodCall.SetProp(x, "XBaseInsProp", "zoo");

            Assert.That(
                MethodCall.GetProp(x, "XBaseInsProp"),
                Is.EqualTo("zoo"));
        }
开发者ID:ppanyukov,项目名称:MethodCall,代码行数:10,代码来源:MethodCall.Tests.cs

示例14: Histogram

		public Histogram(SampleType type)
		{
			switch(type)
			{
				case SampleType.BIASED:
					_sample = new ExponentiallyDecayingSample();
					break;
				case SampleType.UNIFORM:
					_sample = new UniformSample();
					break;
				default:  
			        throw new ArgumentException("Unknown enum value found."); 
			}
		}
开发者ID:ijoyce,项目名称:Metrics.Net,代码行数:14,代码来源:Histogram.cs

示例15: WriteNull

        public void WriteNull()
        {
            var engine = new FileHelperEngine<SampleType>();

            SampleType[] res = new SampleType[3];
            res[0] = new SampleType();
            res[1] = new SampleType();
            res[2] = new SampleType();

            string tempo = engine.WriteString(res);
            res = engine.ReadString(tempo);

            Assert.AreEqual(3, res.Length);
            Assert.AreEqual(3, engine.TotalRecords);
            Assert.AreEqual(0, engine.ErrorManager.ErrorCount);

            Assert.AreEqual(DateTime.MinValue, res[0].Field1);
            Assert.AreEqual("", res[0].Field2);
            Assert.AreEqual(0, res[0].Field3);
        }
开发者ID:jonswaino,项目名称:FileHelpers-fork,代码行数:20,代码来源:NullValues.cs


注:本文中的SampleType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。