本文整理汇总了C#中Encoder类的典型用法代码示例。如果您正苦于以下问题:C# Encoder类的具体用法?C# Encoder怎么用?C# Encoder使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Encoder类属于命名空间,在下文中一共展示了Encoder类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例2: EncoderParameter
public EncoderParameter(Encoder encoder, byte[] value)
{
this.encoder = encoder.Guid;
this.numberOfValues = value.Length;
this.type = EncoderParameterValueType.ValueTypeByte;
this.value = value;
}
示例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;
}
示例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;
}
示例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);
}
示例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));
}
示例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);
}
示例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);
}
示例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());
}
示例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;
}
}
示例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();
}
示例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);
}
示例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);
}
示例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;
}
}
示例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;
}
}