本文整理汇总了C#中DataReader类的典型用法代码示例。如果您正苦于以下问题:C# DataReader类的具体用法?C# DataReader怎么用?C# DataReader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DataReader类属于命名空间,在下文中一共展示了DataReader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
}
}
开发者ID:michyer,项目名称:canape,代码行数:25,代码来源:HttpResponseHeader.cs
示例2: UdgerParser
/// <summary>
/// Constructor
/// </summary>
public UdgerParser()
{
dt = new DataReader();
this.ua = "";
this.ip = "";
}
开发者ID:udger,项目名称:udger-dotnet,代码行数:10,代码来源:UdgerParser.cs
示例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);
}
开发者ID:BrannonKing,项目名称:Kts.Remoting,代码行数:25,代码来源:DdsExtensions.cs
示例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
}
开发者ID:njmube,项目名称:openposbr,代码行数:31,代码来源:TributoRegraBase.cs
示例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();
}
}
}
开发者ID:PNNL-Comp-Mass-Spec,项目名称:PIXIE,代码行数:28,代码来源:BincCentricIndexing.cs
示例6: Populate
public override void Populate(DataReader dataReader)
{
base.Populate(dataReader);
Nivel = dataReader.GetValue<int>("p_Nivel");
Descricao = dataReader.GetValue<string>("p_Descricao");
}
开发者ID:njmube,项目名称:openposbr,代码行数:7,代码来源:NivelAcesso.cs
示例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;
}
开发者ID:alexcmd,项目名称:DiscUtils,代码行数:33,代码来源:AlternateStreamEntry.cs
示例8: GetDividendDataTest
public void GetDividendDataTest()
{
DataReader dataReader = new DataReader();
dataReader.AnalyseDividendFile(TestData.DividendFile);
IDividendData info = dataReader.GetDividendData("432534", DateTime.MinValue);
Assert.IsNull(info);
}
开发者ID:philfanzhou,项目名称:PredictFuture,代码行数:7,代码来源:IDividendDataTest.cs
示例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();
}
开发者ID:koZZZdya,项目名称:TsSoft.Docx.TemplateEngine,代码行数:7,代码来源:ItemTableGenerator.cs
示例10: GetFeatures
public FeatureSet GetFeatures(int targetBin, DataReader.FrameType frameType)
{
List<IntensityPoint> intensityPointList = _uimfUtil.GetXic(targetBin, frameType);
var features = new FeatureSet(intensityPointList);
return features;
}
开发者ID:javamng,项目名称:GitHUB,代码行数:7,代码来源:IMSData.cs
示例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);
}
}
开发者ID:michyer,项目名称:canape,代码行数:36,代码来源:DynamicBinaryStreamPipelineNode.cs
示例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();
}
}
开发者ID:qq573011406,项目名称:UnityAssetTool,代码行数:27,代码来源:TypeTreeDataBaseLearnCommand.cs
示例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");
}
开发者ID:njmube,项目名称:openposbr,代码行数:11,代码来源:TipoUsuario.cs
示例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);
}
开发者ID:philfanzhou,项目名称:PredictFuture,代码行数:7,代码来源:DayLineTest.cs
示例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;
}
开发者ID:bzure,项目名称:BSA.Net,代码行数:13,代码来源:RoleRepository.cs
示例16: Populate
public override void Populate(DataReader dataReader)
{
base.Populate(dataReader);
Nivel = 1;
Descricao = dataReader.GetValue<string>("p_Descricao");
Regras = new NivelAcessoRegra().Find<INivelAcessoRegra>("cad_NivelAcessoRegra.GUIDNivelAcesso", GUID.ToString());
}
开发者ID:njmube,项目名称:openposbr,代码行数:8,代码来源:NivelAcesso.cs
示例17: ProcessItemRepeaterElement
private void ProcessItemRepeaterElement(RepeaterElement itemRepeaterElement, DataReader reader, int index,
XElement previous)
{
var readers = reader.GetReaders(itemRepeaterElement.Expression);
var itemRepeaterTag = GenerateItemRepeaterTag(itemRepeaterElement);
var parser = new ItemRepeaterParser();
parser.Parse(itemRepeaterTag, readers.ToList());
}
开发者ID:koZZZdya,项目名称:TsSoft.Docx.TemplateEngine,代码行数:8,代码来源:RepeaterProcessor.cs
示例18: MemberMap
public MemberMap(DataReader reader)
{
Id = reader.ReadInt16();
Name = reader.ReadString();
DbType = DbType.Read(reader);
MemberType = DbType.Type;
}
开发者ID:xperiandri,项目名称:lex.db,代码行数:8,代码来源:MemberMap.cs
示例19: LoadBody
protected override void LoadBody(IDataReader reader, IMessage message)
{
Console.WriteLine("Receive Data length:" + reader.Length);
using (GZipStream compStream = new GZipStream((Stream)reader, CompressionMode.Decompress))
{
DataReader dw = new DataReader(compStream, reader.LittleEndian);
base.LoadBody(dw, message);
}
}
开发者ID:hdxhan,项目名称:IKendeLib,代码行数:9,代码来源:CompressionPackage.cs
示例20: ExecuteReader
public DataReader ExecuteReader()
{
var cursor = MongoConnection.MongoDatabase.GetCollection(CollectionName).FindAll();
Result result = new Result(cursor);
ResultSet resultSet = new ResultSet();
resultSet.Add(result);
DataReader reader = new DataReader(resultSet);
return reader;
}
开发者ID:mdcuesta,项目名称:anito.net,代码行数:9,代码来源:Command.cs
注:本文中的DataReader类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论