• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Encoder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: OrderProcessingFun

        public void OrderProcessingFun(OrderClass obj_1)
        {
            Encoder encode = new Encoder();
            senderId = obj_1.get_senderId();
            cardNo = obj_1.get_cardNo();
            receiverId = obj_1.get_receiverId();
            amount = obj_1.get_amount();
            unitprice = obj_1.get_unitprice();

            string encodedString;

            if (!IsValidCardNo(cardNo) || amount == 0)
            {
                obj_1.set_confirmationstatus(false);
                obj_1.set_totalamount(0);
                encodedString = encode.encryptString(obj_1);
              //  ConfirmationBuffer.setOneCell(encodedString);

            }
            else
            {
                CalculatePrice();
                obj_1.set_confirmationstatus(true);
                obj_1.set_totalamount(TotalAmount);

                encodedString = encode.encryptString(obj_1);
            //    ConfirmationBuffer.setOneCell(encodedString);

            }
            if (encodedString != null)
            {
                OrderConfirmation(encodedString);
            }
        }
开发者ID:veenarajan,项目名称:AirlineTicketSystem,代码行数:34,代码来源:OrderProcessing.cs


示例2: EncoderParameter

	public EncoderParameter(Encoder encoder, byte[] value)
			{
				this.encoder = encoder.Guid;
				this.numberOfValues = value.Length;
				this.type = EncoderParameterValueType.ValueTypeByte;
				this.value = value;
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:7,代码来源:EncoderParameter.cs


示例3: ExportScanner

        private IPlaylistWriter writer; // playlist writer

        #endregion Fields

        #region Constructors

        //========================================================================================
        // Constructor
        //========================================================================================
        /// <summary>
        /// Initialize a new instance of this scanner.
        /// </summary>
        /// <param name="itunes">The iTunesAppClass to use.</param>
        /// <param name="exportPIDs">
        /// The list of persistent track IDs.  When exporting multiple playlists, this list
        /// should include all tracks from all playlists where each track indicates its own
        /// source playlist.  This allows comprehensive/overall feedback for UI progress bars.
        /// </param>
        /// <param name="encoder">The encoder to use to convert tracks.</param>
        /// <param name="playlistFormat">
        /// The playlist output format or PlaylistFactory.NoFormat for no playlist file.
        /// </param>
        /// <param name="location">
        /// The target root directory path to which all entries will be copied or converted.
        /// </param>
        /// <param name="pathFormat">
        /// The path format string as specified in FolderFormts.xml or null for title only.
        /// </param>
        /// <param name="isSynchronized">
        /// True if target location should be synchronized, removing entries in the target
        /// location that are not included in the exportPIDs collection.
        /// </param>
        public ExportScanner(
            Controller controller, PersistentIDCollection exportPIDs,
            Encoder encoder, string playlistFormat, string location, string pathFormat,
            bool isSynchronized)
        {
            base.name = Resx.I_ScanExport;
            base.description = isSynchronized ? Resx.ScanSynchronize : Resx.ScanExport;
            base.controller = controller;

            this.exportPIDs = exportPIDs;
            this.encoder = encoder;
            this.expectedType = encoder.ExpectedType;
            this.playlistFormat = playlistFormat;
            this.playlistName = exportPIDs.Name;
            this.location = location;
            this.createSubdirectories = (pathFormat != null);
            this.pathFormat = pathFormat ?? PathHelper.GetPathFormat(FlatPathFormat);
            this.isSynchronized = isSynchronized;

            this.exports = null;
            this.writer = null;

            this.slim = new ReaderWriterLockSlim();
            this.waitSyncRoot = null;
        }
开发者ID:pengyancai,项目名称:cs-util,代码行数:57,代码来源:ExportScanner.cs


示例4: BitmapSourceConverter

        /// <summary>
        /// Ctor.
        /// </summary>
        /// <param name="format">The pixel format to use for conversion.</param>
        /// <param name="encoder">The encoder to use.</param>
        /// <param name="rotate">Degrees of rotation to apply (counterclock whise).</param>
        public BitmapSourceConverter(PixelFormat format, Encoder encoder, int rotate = 0)
        {
            _format = format;
            _encoder = encoder;

            Rotate = rotate;
        }
开发者ID:skpdvdd,项目名称:Pdf2KT,代码行数:13,代码来源:BitmapSourceConverter.cs


示例5: Encode

        /// <summary>
        /// Encodes a frame.
        /// </summary>
        /// <param name="frame">The video buffer.</param>
        /// <returns></returns>
        public override byte[] Encode(VideoBuffer frame)
        {
            if (Encoder == null)
            {
                Encoder = new Encoder();
                Encoder.Quality = 0.5;
                Encoder.Bitrate = 320;
                //Encoder.Scale = 1.0;
            }

            if (frame.ResetKeyFrame)
            {
                Encoder.ForceKeyframe();
            }

            // frame -> vp8
            int width, height;
            var rotate = frame.Rotate;
            if (rotate % 180 == 0)
            {
                width = frame.Width;
                height = frame.Height;
            }
            else
            {
                height = frame.Width;
                width = frame.Height;
            }
            return Encoder.Encode(width, height, frame.Plane.Data, frame.FourCC, rotate);
        }
开发者ID:QuickBlox,项目名称:quickblox-dotnet-sdk,代码行数:35,代码来源:Vp8Codec.cs


示例6: TomP2POutbound

 public TomP2POutbound(bool preferDirect, ISignatureFactory signatureFactory, CompByteBufAllocator alloc)
 {
     _preferDirect = preferDirect;
     _signatureFactory = signatureFactory;
     _encoder = new Encoder(signatureFactory);
     _alloc = alloc;
     //Logger.Info("Instantiated with object identity: {0}.", RuntimeHelpers.GetHashCode(this));
 }
开发者ID:pacificIT,项目名称:TomP2P.NET,代码行数:8,代码来源:TomP2POutbound.cs


示例7: EncoderParameter

 public EncoderParameter(Encoder encoder, short[] value)
 {
     this.encoder = encoder;
     this.valuesCount = value.Length;
     this.type = EncoderParameterValueType.ValueTypeShort;
     this.valuePtr = Marshal.AllocHGlobal(2 * valuesCount);
     Marshal.Copy(value, 0, this.valuePtr, valuesCount);
 }
开发者ID:NelsonSantos,项目名称:fyiReporting-Android,代码行数:8,代码来源:EncoderParameter.cs


示例8: Encode

        public override void Encode(Stream stream, Encoding encoding = null)
        {
            if (_writeEncoder != null) return;

            var encoder = new Encoder(stream, encoding ?? 
                _encoding, _options, NodeFormat, _type);
            _writeRows.ForEach(encoder.Write);
        }
开发者ID:mikeobrien,项目名称:Bender,代码行数:8,代码来源:FileNode.cs


示例9: FakeEncoderFixture

 public FakeEncoderFixture(DioCrossConnectFixture dio1, DioCrossConnectFixture dio2)
 {
     Assert.NotNull(dio1);
     Assert.NotNull(dio2);
     m_dio1 = dio1;
     m_dio2 = dio2;
     m_allocated = false;
     m_source = new FakeEncoderSource(dio1.GetOutput(), dio2.GetOutput());
     m_encoder = new Encoder(dio1.GetInput(), dio2.GetInput());
 }
开发者ID:chopshop-166,项目名称:WPILib,代码行数:10,代码来源:FakeEncoderFixture.cs


示例10: Encode

 public void Encode(Encoder rangeEncoder, byte symbol)
 {
     uint context = 1;
     for (int i = 7; i >= 0; i--)
     {
         uint bit = (uint)((symbol >> i) & 1);
         m_Encoders[context].Encode(rangeEncoder, bit);
         context = (context << 1) | bit;
     }
 }
开发者ID:SirJamal,项目名称:Sulakore,代码行数:10,代码来源:LzmaEncoder.cs


示例11: WebService

        /**
         * Constructor for WebService
         * @param prefix string where the server should listen. Example "http://localhost:8080/"
         */
        public WebService(string prefix, Encoder encoder, Streaming streaming)
        {
            log.Debug("Creating Web Service");
            this.dvrbConfig = null;
            this.uriPrefixes = new string[] { prefix };
            this.encoder = encoder;
            this.streaming = streaming;

            // Create a listener.
            this.listener = new HttpListener();
        }
开发者ID:ejgarcia,项目名称:isabel,代码行数:15,代码来源:WebService.cs


示例12: PgmSender

 public PgmSender(IOThread ioThread, Options options, Address addr)
     : base(ioThread)
 {
     m_options = options;
     m_addr = addr;
     m_encoder = null;
     m_outBuffer = null;
     m_outBufferSize = 0;
     m_writeSize = 0;
     m_encoder = new Encoder(0, m_options.Endian);
 }
开发者ID:GianniBortoloBossini,项目名称:netmq,代码行数:11,代码来源:PgmSender.cs


示例13: button1_Click

        private void button1_Click(object sender, EventArgs e)
        {
            Encoder encoder = new Encoder();
            encoder.Indent = true;

            Test o = new Test();
            string s = encoder.Encode(o);

            richTextBox1.Clear();
            richTextBox1.AppendText(s);
        }
开发者ID:mayatforest,项目名称:Refractor,代码行数:11,代码来源:Form1.cs


示例14: ReverseEncode

		public void ReverseEncode(Encoder rangeEncoder, UInt32 symbol)
		{
			UInt32 m = 1;
			for (UInt32 i = 0; i < NumBitLevels; i++)
			{
				UInt32 bit = symbol & 1;
				Models[m].Encode(rangeEncoder, bit);
				m = (m << 1) | bit;
				symbol >>= 1;
			}
		}
开发者ID:sharedsafe,项目名称:SharedSafe.Encoding,代码行数:11,代码来源:RangeCoderBitTree.cs


示例15: Encode

		public void Encode(Encoder rangeEncoder, UInt32 symbol)
		{
			UInt32 m = 1;
			for (int bitIndex = NumBitLevels; bitIndex > 0; )
			{
				bitIndex--;
				UInt32 bit = (symbol >> bitIndex) & 1;
				Models[m].Encode(rangeEncoder, bit);
				m = (m << 1) | bit;
			}
		}
开发者ID:sharedsafe,项目名称:SharedSafe.Encoding,代码行数:11,代码来源:RangeCoderBitTree.cs


示例16: OnStart

        // Service start
        protected override void OnStart(string[] args)
        {
            log.Trace("-------------------------------");
            log.Trace("DVRB STARTING APPLICATION...");
            log.Trace("-------------------------------");

            this.policyServer = new FlashPolicyServer();
            this.encoder = new Encoder();
            this.stream = new Streaming();
            this.webService = new WebService("http://+:8080/", this.encoder, this.stream);
            this.policyServer.Start();
            this.webService.StartWebServiceListener();
        }
开发者ID:ejgarcia,项目名称:isabel,代码行数:14,代码来源:DVRBService.cs


示例17: testOrder

        //Test method to verify encode/decode service with orderclass
        static Boolean testOrder()
        {
            OrderClass order = new OrderClass();
            order.setAmt(123);
            order.setID("test");
            order.setCardNo(456418);

            Encoder enc = new Encoder(order);
            String encoded = enc.getOrder();
            Decoder dec = new Decoder(encoded);

            return order == dec.getOrder();
        }
开发者ID:gtscherer,项目名称:CSE445_Project2,代码行数:14,代码来源:Program.cs


示例18: TestChannelChannelReverseInit

 public void TestChannelChannelReverseInit()
 {
     using (Encoder x = new Encoder(1, 2, true))
     {
         Assert.IsTrue(SimData.Encoder[0].Initialized);
         CheckConfig(SimData.Encoder[0].Config, 0, 1, false, 0, 2, false);
         Assert.IsTrue(SimData.Encoder[0].ReverseDirection);
         Assert.IsTrue(SimData.DIO[1].Initialized);
         Assert.IsTrue(SimData.DIO[2].Initialized);
     }
     Assert.IsFalse(SimData.Encoder[0].Initialized);
     Assert.IsFalse(SimData.DIO[1].Initialized);
     Assert.IsFalse(SimData.DIO[2].Initialized);
 }
开发者ID:chopshop-166,项目名称:WPILib,代码行数:14,代码来源:TestEncoders.cs


示例19: EncodeTest

        public void EncodeTest()
        {
            //Arrange
            var cloudStorageConfiguration = new CloudStorageConfiguration(CloudStorageAccount.DevelopmentStorageAccount, new Version());

            var queueVideoRepository = new QueueVideoRepository(cloudStorageConfiguration.StorageAccount.CreateCloudQueueClient());
            var videoRepository = new FakeVideoRepository(_blobSource, _blobDestination);
            var screenshotRepository = new FakeScreenshotRepository(_blobDestination);
            var mediaInfoReader = new MediaInfoReader();
            var encoder = new Encoder();
            var fileSystemWrapper = new FileSystemWrapper();

            var queueProcess = new QueueProcess(1000, queueVideoRepository);
            var downloadProcess = new DownloadProcess(5, videoRepository, fileSystemWrapper);
            var encoderProcess = new EncodeProcess(5, encoder, videoRepository, mediaInfoReader, queueVideoRepository, fileSystemWrapper);
            var uploadProcess = new UploadProcess(5, videoRepository, screenshotRepository, fileSystemWrapper);
            var finishProcess = new FinishProcess(queueVideoRepository, videoRepository, fileSystemWrapper);

            var queueContainer = new ProcessContainer<object, QueueInformation, DownloadInformation>(queueProcess, downloadProcess);
            var downloadContainer = new ProcessContainer<QueueInformation, DownloadInformation, EncodeInformation>(downloadProcess, encoderProcess);
            var encoderContainer = new ProcessContainer<DownloadInformation, EncodeInformation, UploadInformation>(encoderProcess, uploadProcess);
            var uploadContainer = new ProcessContainer<EncodeInformation, UploadInformation, object>(uploadProcess, finishProcess);

            var processManager = new EncodeProcessManager(queueVideoRepository.DeleteMessageLocal);
            processManager.Add(queueContainer);
            processManager.Add(downloadContainer);
            processManager.Add(encoderContainer);
            processManager.Add(uploadContainer);

            var timer = new Timer(UpdateMessages, queueVideoRepository, (int) queueVideoRepository.InvisibleTime.TotalMilliseconds/2, (int) queueVideoRepository.InvisibleTime.TotalMilliseconds/2);

            //Act & Assert
            Task task = processManager.Start();
            StartQueueWork();

            Thread.Sleep(30000);


            while (queueVideoRepository.ApproximateMessageCount > 0)
            {
                Thread.Sleep(60000);
            }

            //Thread.Sleep(50*60*1000);

            processManager.Stop();

            task.Wait();
        }
开发者ID:GusLab,项目名称:video-portal,代码行数:49,代码来源:EncodeProcessManagerTest.cs


示例20: button3_Click

        private void button3_Click(object sender, EventArgs e)
        {
            Encoder encoder = new Encoder();
            encoder.Indent = true;
            Test o = new Test();
            string s = encoder.Encode(o);

            Decoder decoder = new Decoder();
            Test o2 = (Test)decoder.Decode(s);
            string s2 = encoder.Encode(o2);

            if (s == s2)
                richTextBox1.AppendText("OK\n");
            else
                richTextBox1.AppendText("FAIL\n");
        }
开发者ID:mayatforest,项目名称:Refractor,代码行数:16,代码来源:Form1.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Encoding类代码示例发布时间:2022-05-24
下一篇:
C# EncodeType类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap