本文整理汇总了C#中BlockList.FetchBlocks方法的典型用法代码示例。如果您正苦于以下问题:C# BlockList.FetchBlocks方法的具体用法?C# BlockList.FetchBlocks怎么用?C# BlockList.FetchBlocks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BlockList
的用法示例。
在下文中一共展示了BlockList.FetchBlocks方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessProperties
/// <summary>
/// Processes the properties.
/// </summary>
/// <param name="small_blocks">The small_blocks.</param>
/// <param name="big_blocks">The big_blocks.</param>
/// <param name="properties">The properties.</param>
/// <param name="path">The path.</param>
/// <returns></returns>
private List<DocumentDescriptor> ProcessProperties(BlockList small_blocks,
BlockList big_blocks,
IEnumerator properties,
POIFSDocumentPath path)
{
List<DocumentDescriptor> documents =
new List<DocumentDescriptor>();
while (properties.MoveNext())
{
Property property = (Property)properties.Current;
String name = property.Name;
if (property.IsDirectory)
{
POIFSDocumentPath new_path = new POIFSDocumentPath(path,
new String[]
{
name
});
ProcessProperties(
small_blocks, big_blocks,
((DirectoryProperty)property).Children, new_path);
}
else
{
int startBlock = property.StartBlock;
IEnumerator listeners = registry.GetListeners(path, name);
POIFSDocument document = null;
if (listeners.MoveNext())
{
listeners.Reset();
int size = property.Size;
if (property.ShouldUseSmallBlocks)
{
document =
new POIFSDocument(name, small_blocks
.FetchBlocks(startBlock, -1), size);
}
else
{
document =
new POIFSDocument(name, big_blocks
.FetchBlocks(startBlock, -1), size);
}
//POIFSReaderListener listener =
// (POIFSReaderListener)listeners.Current;
//listener.ProcessPOIFSReaderEvent(
// new POIFSReaderEvent(
// new DocumentInputStream(document), path,
// name));
while (listeners.MoveNext())
{
POIFSReaderListener listener =
(POIFSReaderListener)listeners.Current;
listener.ProcessPOIFSReaderEvent(
new POIFSReaderEvent(
new DocumentInputStream(document), path,
name));
}
}
else
{
// consume the document's data and discard it
if (property.ShouldUseSmallBlocks)
{
small_blocks.FetchBlocks(startBlock, -1);
}
else
{
big_blocks.FetchBlocks(startBlock, -1);
}
//documents.Add(
// new DocumentDescriptor(path, name));
//fire event
//OnStreamReaded(new POIFSReaderEventArgs(name, path, document));
}
}
}
return documents;
}
示例2: ProcessProperties
private void ProcessProperties(BlockList small_blocks,
BlockList big_blocks,
IEnumerator properties,
DirectoryNode dir,
int headerPropertiesStartAt)
{
while (properties.MoveNext())
{
Property property = ( Property ) properties.Current;
String name = property.Name;
DirectoryNode parent = (dir == null)
? (( DirectoryNode ) this.Root)
: dir;
if (property.IsDirectory)
{
DirectoryNode new_dir =
( DirectoryNode ) parent.CreateDirectory(name);
new_dir.StorageClsid=property.StorageClsid ;
ProcessProperties(
small_blocks, big_blocks,
((DirectoryProperty)property).Children, new_dir, headerPropertiesStartAt);
}
else
{
int startBlock = property.StartBlock;
int size = property.Size;
POIFSDocument document = null;
if (property.ShouldUseSmallBlocks)
{
document =
new POIFSDocument(name, small_blocks
.FetchBlocks(startBlock, headerPropertiesStartAt), size);
}
else
{
document =
new POIFSDocument(name,
big_blocks.FetchBlocks(startBlock,headerPropertiesStartAt),
size);
}
parent.CreateDocument(document);
}
}
}
示例3: ProcessProperties
/// <summary>
/// Processes the properties.
/// </summary>
/// <param name="small_blocks">The small_blocks.</param>
/// <param name="big_blocks">The big_blocks.</param>
/// <param name="properties">The properties.</param>
/// <param name="path">The path.</param>
/// <returns></returns>
private List<DocumentDescriptor> ProcessProperties(BlockList small_blocks,
BlockList big_blocks,
IEnumerator properties,
POIFSDocumentPath path)
{
List<DocumentDescriptor> documents =
new List<DocumentDescriptor>();
while (properties.MoveNext())
{
Property property = (Property)properties.Current;
String name = property.Name;
if (property.IsDirectory)
{
POIFSDocumentPath new_path = new POIFSDocumentPath(path,
new String[]
{
name
});
ProcessProperties(
small_blocks, big_blocks,
((DirectoryProperty)property).Children, new_path);
}
else
{
int startBlock = property.StartBlock;
int size = property.Size;
POIFSDocument document = null;
if (property.ShouldUseSmallBlocks)
{
document =
new POIFSDocument(name, small_blocks
.FetchBlocks(startBlock,-1), size);
}
else
{
document =
new POIFSDocument(name, big_blocks
.FetchBlocks(startBlock,-1), size);
}
documents.Add(
new DocumentDescriptor(path, name));
//fire event
OnStreamReaded(new POIFSReaderEventArgs(name, path, document));
}
}
return documents;
}