本文整理匯總了C#中System.Resources.ResourceSet.MoveNext方法的典型用法代碼示例。如果您正苦於以下問題:C# ResourceSet.MoveNext方法的具體用法?C# ResourceSet.MoveNext怎麽用?C# ResourceSet.MoveNext使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.Resources.ResourceSet
的用法示例。
在下文中一共展示了ResourceSet.MoveNext方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ShowInfo
private void ShowInfo( Assembly asm )
{
tvResources.Nodes.Clear();
pbValue.Visible = false;
tbValue.Visible = false;
btnExport.Enabled = false;
if( asm != null )
{
try
{
lblStatus.Text = "Loaded: " + asm.FullName;
foreach( string resourceName in asm.GetManifestResourceNames() )
{
TreeNode root = new TreeNode( resourceName );
root.ImageIndex = 1;
root.SelectedImageIndex = 1;
tvResources.Nodes.Add( root );
using( Stream resourceStream = asm.GetManifestResourceStream( resourceName ) )
{
try
{
IDictionaryEnumerator enu = new ResourceSet( resourceStream ).GetEnumerator();
while( enu.MoveNext() )
{
TreeNode node = new TreeNode( enu.Key.ToString() );
root.Nodes.Add( node );
node.ImageIndex = 0;
node.SelectedImageIndex = 0;
if( enu.Value is Icon || enu.Value is Bitmap )
{
node.Tag = enu.Value;
node.ImageIndex = 2;
node.SelectedImageIndex = 2;
}
else if( enu.Value is String )
{
node.Tag = enu.Value;
node.ImageIndex = 3;
node.SelectedImageIndex = 3;
}
else if( enu.Value is ImageListStreamer )
{
ImageList il = new ImageList();
il.ImageStream = (ImageListStreamer)enu.Value;
node.ImageIndex = 1;
node.SelectedImageIndex = 1;
for( int i = 0; i < il.Images.Count; i++ )
{
TreeNode imgNode = new TreeNode( i.ToString() );
imgNode.Tag = il.Images[i];
imgNode.ImageIndex = 2;
imgNode.SelectedImageIndex = 2;
node.Nodes.Add( imgNode );
}
}
}
}
catch
{
try
{
//------------------------------------------------------
// Try treating stream as a single image.
//------------------------------------------------------
root.Tag = new Bitmap( resourceStream );
root.ImageIndex = 2;
root.SelectedImageIndex = 2;
}
catch
{
try
{
//------------------------------------------------------
// Try treating stream as plain text.
//------------------------------------------------------
using( TextReader tr = new StreamReader( resourceStream ) )
{
root.Tag = tr.ReadToEnd();
root.ImageIndex = 0;
root.SelectedImageIndex = 0;
}
}
catch
{
lblStatus.Text = "Error reading resource file.";
}
}
}
}
}
}
catch( Exception ex )
{
//.........這裏部分代碼省略.........