本文整理汇总了C#中PropertyBag.GetBagAt方法的典型用法代码示例。如果您正苦于以下问题:C# PropertyBag.GetBagAt方法的具体用法?C# PropertyBag.GetBagAt怎么用?C# PropertyBag.GetBagAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PropertyBag
的用法示例。
在下文中一共展示了PropertyBag.GetBagAt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadComics
public static ArrayList LoadComics( string fileName )
{
ArrayList comics;
// PropertyBagArray
PropertyBag bags;
comics = new ArrayList();
bags = new PropertyBag();
bags.Load( fileName );
for( int x=0; x < bags.BagCount; x++ )
{
PropertyBag bag;
ComicInfo ci;
bag = (PropertyBag)bags.GetBagAt(x);
ci = new ComicInfo();
for( int y=0; y < bag.PropertyCount; y++ )
{
string name, val;
bag.GetPropertyAt( y, out name, out val );
if( name == "Website" )
{
ci.Website = val;
}
if( name == "FolderName" )
{
ci.FolderName = val;
}
if( name == "DisplayName" )
{
ci.DisplayName = val;
}
else if( name == "ImageSuffix" )
{
ci.ImageSuffix = val;
}
else if( name == "ImageFilename" )
{
ci.ImageFilename = val;
}
else if( name == "ImagePath" )
{
ci.ImagePath = val;
}
else if( name == "Subscribed" )
{
try
{
ci.Subscribed = bool.Parse( val );
}
catch( Exception e )
{
Helpers.AppException.PrintException( e );
}
}
}
comics.Add( ci );
}
return comics;
}