本文整理汇总了C#中DataReader类的典型用法代码示例。如果您正苦于以下问题:C# DataReader类的具体用法?C# DataReader怎么用?C# DataReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataReader类属于命名空间,在下文中一共展示了DataReader类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HttpResponseHeader
internal HttpResponseHeader(DataReader reader, IEnumerable<KeyDataPair<string>> headers, int responseCode, string message, HttpVersion version)
{
_reader = reader;
Headers = new List<KeyDataPair<string>>(headers);
ResponseCode = responseCode;
Message = message;
Version = version;
if (ResponseCode != 304)
{
ContentLength = HttpParser.GetContentLength(Headers);
ChunkedEncoding = HttpParser.IsChunkedEncoding(Headers);
HasBody = true;
}
// Always trust a content-length if it exists
if (Headers.Count(p => p.Name.Equals("Content-Length", StringComparison.OrdinalIgnoreCase)) == 0)
{
// Otherwise if version unknown, 1.0 or connection will close set then indicate we will read to the end
if (Version.IsVersionUnknown || Version.IsVersion10 || (Headers.Count(p => p.Name.Equals("Connection", StringComparison.OrdinalIgnoreCase) && p.Value.Equals("close", StringComparison.OrdinalIgnoreCase)) > 0))
{
ReadToEnd = true;
}
}
}
示例2: UdgerParser
/// <summary>
/// Constructor
/// </summary>
public UdgerParser()
{
dt = new DataReader();
this.ua = "";
this.ip = "";
}
示例3: DomainParticipantTransportSource
public DomainParticipantTransportSource(DomainParticipant participant, string senderTopic, string receiverTopic)
{
_participant = participant;
var senderTopicQos = new TopicQos();
participant.get_default_topic_qos(senderTopicQos);
var receiverTopicQos = new TopicQos();
participant.get_default_topic_qos(receiverTopicQos);
_sender = participant.create_topic(senderTopic, BytesTypeSupport.TYPENAME, senderTopicQos, null, StatusMask.STATUS_MASK_NONE);
_receiver = participant.create_topic(receiverTopic, BytesTypeSupport.TYPENAME, receiverTopicQos, null, StatusMask.STATUS_MASK_NONE);
var writerQos = new DataWriterQos();
//writerQos.publish_mode.kind = PublishModeQosPolicyKind.ASYNCHRONOUS_PUBLISH_MODE_QOS;
writerQos.publish_mode.flow_controller_name = FlowController.FIXED_RATE_FLOW_CONTROLLER_NAME;
participant.get_default_datawriter_qos(writerQos);
var readerQos = new DataReaderQos();
participant.get_default_datareader_qos(readerQos);
_writer = participant.create_datawriter(_sender, writerQos, null, StatusMask.STATUS_MASK_NONE);
_reader = participant.create_datareader(_receiver, readerQos, this, StatusMask.STATUS_MASK_ALL);
}
示例4: Populate
/// <summary>
/// Método utilizado para preencher esta instância com os dados do dataReader
/// </summary>
/// <param name="dataReader">DataReader com os dados que deverão ser passados para esta instância</param>
public override void Populate(DataReader dataReader)
{
#region base
base.Populate(dataReader);
#endregion
#region desta classe
Descricao = dataReader.GetValue<string>("p_Descricao");
#region Filtros
Filtros = new TributoRegraFiltro().Find<ITributoRegraFiltro, ITributoRegra>(new Where()
{
{"cad_TributoRegraFiltro.GUIDTributoRegra", GUID.ToString() }
}, this);
#endregion
#region Aliquotas
Aliquotas = new TributoRegraAliquota().Find<ITributoRegraAliquota, ITributoRegra>(new Where()
{
{"cad_TributoRegraAliquota.GUIDTributoRegra",GUID.ToString() }
}, this);
#endregion
#endregion
}
示例5: IndexUimfFile
public static void IndexUimfFile(string uimfFileLocation)
{
bool indexed = false;
using (var uimfReader = new DataReader(uimfFileLocation))
{
if (uimfReader.DoesContainBinCentricData())
{
indexed = true;
Console.WriteLine("Bin centric data found in dataset {0}.", uimfFileLocation);
}
else
{
Console.WriteLine("No bin centric data found for file {0}.", uimfFileLocation);
}
uimfReader.Dispose();
}
if (!indexed)
{
Console.WriteLine("Creating bin centric data for {0}.", uimfFileLocation);
using (DataWriter dataWriter = new DataWriter(uimfFileLocation))
{
dataWriter.CreateBinCentricTables();
dataWriter.Dispose();
}
}
}
示例6: Populate
public override void Populate(DataReader dataReader)
{
base.Populate(dataReader);
Nivel = dataReader.GetValue<int>("p_Nivel");
Descricao = dataReader.GetValue<string>("p_Descricao");
}
示例7: ReadFrom
public static AlternateStreamEntry ReadFrom(DataReader reader)
{
long startPos = reader.Position;
long length = reader.ReadInt64();
if (length == 0)
{
return null;
}
reader.Skip(8);
AlternateStreamEntry result = new AlternateStreamEntry();
result.Length = length;
result.Hash = reader.ReadBytes(20);
int nameLength = reader.ReadUInt16();
if (nameLength > 0)
{
result.Name = Encoding.Unicode.GetString(reader.ReadBytes(nameLength + 2)).TrimEnd('\0');
}
else
{
result.Name = string.Empty;
}
if (startPos + length > reader.Position)
{
int toRead = (int)(startPos + length - reader.Position);
reader.Skip(toRead);
}
return result;
}
示例8: GetDividendDataTest
public void GetDividendDataTest()
{
DataReader dataReader = new DataReader();
dataReader.AnalyseDividendFile(TestData.DividendFile);
IDividendData info = dataReader.GetDividendData("432534", DateTime.MinValue);
Assert.IsNull(info);
}
示例9: Generate
public void Generate(XElement startTableElement, XElement endTableElement, DataReader dataReader)
{
var coreParser = new CoreTableParser(true);
var tag = coreParser.Parse(startTableElement, endTableElement);
var processor = new TableProcessor() { DataReader = dataReader, TableTag = tag };
processor.Process();
}
示例10: GetFeatures
public FeatureSet GetFeatures(int targetBin, DataReader.FrameType frameType)
{
List<IntensityPoint> intensityPointList = _uimfUtil.GetXic(targetBin, frameType);
var features = new FeatureSet(intensityPointList);
return features;
}
示例11: OnRead
/// <summary>
/// Function called to handle the reading of the stream
/// </summary>
/// <param name="stm">The reading stream</param>
protected override void OnRead(PipelineStream stm)
{
try
{
while (!stm.Eof)
{
DynamicStreamDataKey2 key = new DynamicStreamDataKey2("Root", Container, Graph.Logger, State);
DataReader reader = new DataReader(stm);
key.FromReader(reader);
// Only fill in the frame if we read something, should this exit if it continues to read nothing?
if (reader.ByteCount > 0)
{
WriteOutput(new DataFrame(key));
}
}
}
catch (ThreadAbortException)
{
throw;
}
catch (EndOfStreamException)
{
// End of stream, do nothing
}
catch (Exception e)
{
LogException(e);
}
}
示例12: learnFormAssetBundle
private void learnFormAssetBundle(string path)
{
FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read);
DataReader br = new DataReader(fs);
SerializeBundle bundle = new SerializeBundle();
bundle.DeSerialize(br);
foreach (var bundleEntry in bundle.entrys) {
int version = AssetToolUtility.GetAssetsFileVersion(bundleEntry.assetData);
var serializeAssets = SerializeAssetFactory.CreateWithVersion(version);
if (serializeAssets != null) {
MemoryStream ms = new MemoryStream(bundleEntry.assetData);
DataReader dr = new DataReader(ms);
serializeAssets.DeSerialize(dr);
var assetTypeTreeDB = AssetToolUtility.GenerateTypeTreeDataBase(serializeAssets);
if (assetTypeTreeDB != null) {
var allType = assetTypeTreeDB.GetAllType(version);
foreach (var type in allType) {
Console.WriteLine("AddType:Version:{0},ClassID{1},Name:{2}", version, type.Key, type.Value.type);
}
}
typeTreeDatabase = assetTypeTreeDB.Merage(typeTreeDatabase);
} else {
Debug.LogError("can't deserialize bundle entry " + bundleEntry.name);
}
fs.Dispose();
}
}
示例13: Populate
/// <summary>
/// Método utilizado para preencher esta instância com os dados do dataReader
/// </summary>
/// <param name="dataReader">DataReader com os dados que deverão ser passados para esta instância</param>
public override void Populate(DataReader dataReader)
{
base.Populate(dataReader);
Descricao = dataReader.GetValue<String>("p_Descricao");
Administrador = dataReader.GetValue<Boolean>("p_Administrador");
}
示例14: GetDayLineTest
public void GetDayLineTest()
{
DataReader dataReader = new DataReader();
dataReader.AnalyseDayLineFiles(new[] { TestData.ShanghaiDay, TestData.ShenzhenDay });
IKlineData klineData = dataReader.GetDaylineData("432534", DateTime.MinValue);
Assert.IsNull(klineData);
}
示例15: Role_Map
/// <summary>
/// 角色实体数据映射
/// </summary>
/// <param name="reader"></param>
/// <returns></returns>
public static TeamRole Role_Map(DataReader reader)
{
TeamRole role = new TeamRole(reader.GetString("RoleID"), reader.GetStringNullable("RoleName"))
{
RoleDescription = reader.GetString("Description")
};
return role;
}