当前位置: 首页>>代码示例>>C#>>正文


C# AnItem.RecordInstalledImageSizes方法代码示例

本文整理汇总了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");
        }
开发者ID:Biswo,项目名称:n2cms,代码行数:15,代码来源:ImageSizesMigrationTests.cs

示例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);
        }
开发者ID:Biswo,项目名称:n2cms,代码行数:22,代码来源:ImageSizesMigrationTests.cs


注:本文中的AnItem.RecordInstalledImageSizes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。