本文整理匯總了C#中AnItem.RecordInstalledImageSizes方法的典型用法代碼示例。如果您正苦於以下問題:C# AnItem.RecordInstalledImageSizes方法的具體用法?C# AnItem.RecordInstalledImageSizes怎麽用?C# AnItem.RecordInstalledImageSizes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類AnItem
的用法示例。
在下文中一共展示了AnItem.RecordInstalledImageSizes方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Sizes_CanBeRecorded
public void Sizes_CanBeRecorded()
{
AnItem item = new AnItem();
var sizes = new ImageSizesCollection();
sizes.Clear();
sizes.Add(new ImageSizeElement { Name = "x", Width = 2, Height = 1, Mode = N2.Web.Drawing.ImageResizeMode.FitCenterOnTransparent });
sizes.Add(new ImageSizeElement { Name = "y", Width = 666, Height = 444, Mode = N2.Web.Drawing.ImageResizeMode.Fill });
item.RecordInstalledImageSizes(sizes);
item.GetDetailCollection(InstallationManager.installationImageSizes, false)[0].ShouldBe("x=2,1,FitCenterOnTransparent");
item.GetDetailCollection(InstallationManager.installationImageSizes, false)[1].ShouldBe("y=666,444,Fill");
}
示例2: Sizes_CanBeRead
public void Sizes_CanBeRead()
{
AnItem item = new AnItem();
var sizes = new ImageSizesCollection();
sizes.Clear();
sizes.Add(new ImageSizeElement { Name = "x", Width = 2, Height = 1, Mode = N2.Web.Drawing.ImageResizeMode.FitCenterOnTransparent });
sizes.Add(new ImageSizeElement { Name = "y", Width = 666, Height = 444, Mode = N2.Web.Drawing.ImageResizeMode.Fill });
item.RecordInstalledImageSizes(sizes);
var readSizes = item.GetInstalledImageSizes().ToList();
readSizes[0].Name.ShouldBe("x");
readSizes[0].Width.ShouldBe(2);
readSizes[0].Height.ShouldBe(1);
readSizes[0].Mode.ShouldBe(N2.Web.Drawing.ImageResizeMode.FitCenterOnTransparent);
readSizes[1].Name.ShouldBe("y");
readSizes[1].Width.ShouldBe(666);
readSizes[1].Height.ShouldBe(444);
readSizes[1].Mode.ShouldBe(N2.Web.Drawing.ImageResizeMode.Fill);
}